L
LordVissie
Guest
Hi, I got a problem with ( I think ) my Changegold.lua:
When I buy for example 100 strong mana pots I'll get the pots and 2 golden nuggets like this:
Also if I change 100cc to a golden nugget it gives me this error:
Changing 100cc to 1 golden nugget or vice-versa works good but It still gives me the error. If I need to post any more scripts please tell me.
My Changegold.lua:
My Changenugget.lua:
I'm using version 0.3.6!
__________________
Thanks for the help.
Cya
When I buy for example 100 strong mana pots I'll get the pots and 2 golden nuggets like this:
Also if I change 100cc to a golden nugget it gives me this error:
Code:
[03/10/2015 20:12:09] [Error - Action Interface]
[03/10/2015 20:12:09] data/actions/scripts/other/changegold.lua:onUse
[03/10/2015 20:12:09] Description:
[03/10/2015 20:12:09] data/actions/scripts/other/changegold.lua:26: attempt to index field '?' (a nil value)
[03/10/2015 20:12:09] stack traceback:
[03/10/2015 20:12:09] data/actions/scripts/other/changegold.lua:26: in function <data/actions/scripts/other/changegold.lua:13>
Changing 100cc to 1 golden nugget or vice-versa works good but It still gives me the error. If I need to post any more scripts please tell me.
My Changegold.lua:
Code:
local coins = {
[ITEM_GOLD_COIN] = {
to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW
},
[ITEM_PLATINUM_COIN] = {
from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE
},
[ITEM_CRYSTAL_COIN] = {
from = ITEM_PLATINUM_COIN, to = 2157, effect = TEXTCOLOR_TEAL
},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then
return false
end
local coin = coins[item.itemid]
if(not coin) then
return false
end
if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then
doChangeTypeItem(item.uid, item.type - item.type)
doPlayerAddItem(cid, coin.to, 1)
doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)
elseif(coin.from ~= nil) then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
end
return true
end
My Changenugget.lua:
Code:
--Configurations
local ITEM_NUGGET = 2157 -- Nugget ID
--End of Configs
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == ITEM_NUGGET then --Nugget to Crystal Coin
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "Crystal", TEXTCOLOR_TEAL)
else
return FALSE
end
return TRUE
end
I'm using version 0.3.6!
__________________
Thanks for the help.
Cya
Last edited by a moderator: