• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Can some one Help me with a Quick.. Problem..???

Death Bot

Map Editor
Joined
Mar 25, 2009
Messages
36
Reaction score
0
Location
Florida
How do i change my Crystal Coins (At 100) to Gold Nugget's.. i know it's a "Noob question" to a professional. But im new so Help please.
 
Lua:
-- config --
local platinum_coin = ? -- The itemid of a platinum coin
local crystal_coin = 3043 -- The itemid of a crystal coin
local golden_nugget = ? -- The itemid of a golden nugget
-- end config --

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == crystal_coin and item.type == 100 then
        doRemoveItem(item.uid, 100)
        doPlayerAddItem(cid, golden_nugget, 1)
        doSendAnimatedText(playerPos, "$$$", TEXTCOLOR_GOLD)
    elseif item.itemid == crystal_coin and item.type < 100 then
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, platinum_coin, 100)
        doSendAnimatedText(playerPos, "$$$", TEXTCOLOR_BLUE)
    elseif item.itemid == golden_nugget then
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, crystal_coin, 100)
        doSendAnimatedText(playerPos, "$$$", TEXTCOLOR_BLUE)
    end
end

I think this should work.. Havent tested it since im on a mac.
Need to fill in the missing item ids tho ;)
 
Lua:
-- config --
local platinum_coin = ? -- The itemid of a platinum coin
local crystal_coin = 3043 -- The itemid of a crystal coin
local golden_nugget = ? -- The itemid of a golden nugget
-- end config --

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == crystal_coin and item.type == 100 then
        doRemoveItem(item.uid, 100)
        doPlayerAddItem(cid, golden_nugget, 1)
        doSendAnimatedText(playerPos, "$$$", TEXTCOLOR_GOLD)
    elseif item.itemid == crystal_coin and item.type < 100 then
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, platinum_coin, 100)
        doSendAnimatedText(playerPos, "$$$", TEXTCOLOR_BLUE)
    elseif item.itemid == golden_nugget then
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, crystal_coin, 100)
        doSendAnimatedText(playerPos, "$$$", TEXTCOLOR_BLUE)
    end
end

I think this should work.. Havent tested it since im on a mac.
Need to fill in the missing item ids tho ;)


where he should past this shit? You didnt explained it.. NOOOOB:thumbup:
 
In Actions/Scripts/
add
Lua:
 -- config --
local platinum_coin = 2152 -- The itemid of a platinum coin
local crystal_coin = 3043 -- The itemid of a crystal coin
local golden_nugget = ? -- The itemid of a golden nugget
-- end config --

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == crystal_coin and item.type == 100 then
        doRemoveItem(item.uid, 100)
        doPlayerAddItem(cid, golden_nugget, 1)
        doSendAnimatedText(playerPos, "$$$", TEXTCOLOR_GOLD)
    elseif item.itemid == crystal_coin and item.type < 100 then
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, platinum_coin, 100)
        doSendAnimatedText(playerPos, "$$$", TEXTCOLOR_BLUE)
    elseif item.itemid == golden_nugget then
        doRemoveItem(item.uid, 1)
        doPlayerAddItem(cid, crystal_coin, 100)
        doSendAnimatedText(playerPos, "$$$", TEXTCOLOR_BLUE)
    end
end


then add in Actions.xml

Lua:
<!-- Change gold -->
	<action itemid="2148" event="script" value="other/SCRIPT_NAME.lua"/>
	<action itemid="2152" event="script" value="other/SCRIPT_NAME.lua"/>
	<action itemid="2160" event="script" value="other/SCRIPT_NAME.lua"/>
	<action itemid="GOLDENNUGGETID"event="script" value="other/SCRIPT_NAME.lua"/>
 
Back
Top