ziggy46802
Active Member
- Joined
- Aug 19, 2012
- Messages
- 418
- Reaction score
- 27
Well what I want this to do is have a lever, with the action id "3333" since I have multiples of these levers, and when you pull this lever, it changes 100 gold coins into 1 platinum coin. Kind of like the old old banker npc but using levers to do it instead. The script works fine but if you have just a pile of, say 4 gold coins, it will change those 4 into 1 platinum coin instead of removing 100 it just takes the 4? What did I do wrong in this script, why can players just make stacks of 1 gold and turn them into platinum coins?
Code:
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 3333 then
if getPlayerItemCount(cid, ITEM_GOLD_COIN) >= 100
and doPlayerRemoveItem(cid, ITEM_GOLD_COIN, 100)
then doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
if getPlayerItemCount(cid, ITEM_GOLD_COIN) < 100
then doSendMagicEffect(frompos, CONST_ME_POFF)
end
end
return true
end
end