Grehy
Killroy
Hello! I'm trying to make it that so when you have 100 crystal coins, you can turn them into a gold ingot. Right now, when I use 100 crystal coins, I get the little message over my head, but the coins just dissapear. Heres the error I get in console;
[02/05/2009 02:51:11] Lua Script Error: [Action Interface]
[02/05/2009 02:51:11] data/actions/scripts/other/changegold.lua
nUse
[02/05/2009 02:51:11] luaDoPlayerAddItem(). Item not found
Here is my changegold.lua file;
Any help would be GREATLY appreciated, you can expect some rep. Thanks!
P.S, using TFS 3 beta
[02/05/2009 02:51:11] Lua Script Error: [Action Interface]
[02/05/2009 02:51:11] data/actions/scripts/other/changegold.lua
[02/05/2009 02:51:11] luaDoPlayerAddItem(). Item not found
Here is my changegold.lua file;
Code:
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_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 and item.type < ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_LIGHTBLUE)
elseif item.itemid == ITEM_CRYSTAL_COIN and item.type == ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, ITEM_GOLD_INGOT, 1)
doSendAnimatedText(fromPosition, "BIG MONEY", TEXTCOLOR_LIGHTBLUE)
elseif item.itemid == ITEM_GOLD_INGOT and item.type < ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_LIGHTBLUE)
elseif item.itemid == ITEM_GOLD_INGOT and item.type == ITEMCOUNT_MAX then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1000)
doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_LIGHTBLUE)
else
return FALSE
end
return TRUE
end
Any help would be GREATLY appreciated, you can expect some rep. Thanks!
P.S, using TFS 3 beta