megazx
Graphic designer
this script change the 100 crystal coins to 1 gold nugget but whe i have 100 gold nuggets and i click on them the they vanish they dont change back to 99 gold nuggets and 100 cc so please i need a fix
[12:45:37.653] [Error - Action Interface][12:45:37.653] data/actions/scripts/other/changegold.luanUse
[12:45:37.653] Description:
[12:45:37.653] (luaDoPlayerAddItem) Item not found
this is the script
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_LIGHTBLUE)
elseif item.itemid == ITEM_PLATINUM_COIN and item.type == ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_TEAL)
elseif item.itemid == ITEM_CRYSTAL_COIN and item.type == ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, ITEM_GOLD_NUGGET, 1)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_GREEN)
elseif item.itemid == ITEM_GOLD_NUGGET and item.type == ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, ITEM_GOLD_INGOT, 1)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_GREEN)
elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_YELLOW)
elseif item.itemid == ITEM_CRYSTAL_COIN then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_LIGHTBLUE)
elseif item.itemid == ITEM_GOLD_NUGGET then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_GREEN)
elseif item.itemid == ITEM_GOLD_INGOT then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_GOLD_NUGGET, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_GREEN)
else
return FALSE
end
return TRUE
end
Last edited: