• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Changing gold doesn't work correctly.

Benna

Member
Joined
Jul 3, 2008
Messages
151
Reaction score
7
Alright so if i right click any stack that's on the floor with etc 100 gold coin, platinum, crystal coin i will receive the changing amount to my main backpack but the money will still be on the floor.

So how do i fix it? This is my current goldchanger action lua.


Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then
        doPlayerRemoveItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type == ITEMCOUNT_MAX then
        doPlayerRemoveItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
        doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1)
    elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then
        doPlayerRemoveItem(cid, ITEM_PLATINUM_COIN, 1)
        doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
    elseif item.itemid == ITEM_CRYSTAL_COIN then
        doPlayerRemoveItem(cid, ITEM_CRYSTAL_COIN, 1)
        doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
    else
        return FALSE
    end
    return TRUE
end
 
Back
Top