tfs 0.3.6
ERROR WHEN LOADING SERVER :
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 = ITEM_VALUABLE_COIN, effect = TEXTCOLOR_RED
},
[ITEM_VALUABLE_COIN] = {
from = ITEM_CRYSTAL_COIN, 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
Code:
<item id="2157" article="a" name="valuable coin" plural="valuable coins">
<attribute key="weight" value="10" />
<attribute key="worth" value="1000000" />
</item>
ERROR WHEN LOADING SERVER :
[19/05/2014 12:11:35] [Error - Action Interface]
[19/05/2014 12:11:35] data/actions/scripts/other/changegold.lua
[19/05/2014 12:11:36] Description:
[19/05/2014 12:11:36] data/actions/scripts/other/changegold.lua:13: table index is nil
[19/05/2014 12:11:36] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/changegold.lua)
Last edited: