tuduras
Well-Known Member
- Joined
- Jun 4, 2017
- Messages
- 340
- Solutions
- 2
- Reaction score
- 58
Hello Otlanders,
I have item 100violet skins, which is changing to 1 violet collections.
to -->
. And I have got a script:
after which occurs ERROR in console.
Can You help me ?
I'm using otx 2.16 based on 0.3.7
I have item 100violet skins, which is changing to 1 violet collections.
LUA:
local coins = {
[ITEM_VIOLET_SKIN] = {
to = ITEM_VIOLET_COLLECTION, effect = TEXTCOLOR_TEAL
},
[ITEM_VIOLET_COLLECTION] = {
from = ITEM_VIOLET_SKIN, effect = TEXTCOLOR_TEAL
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 46002) < os.time() - 2 then
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, "~Skins~", coins[coin.to].effect)
elseif(coin.from ~= nil) then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
doSendAnimatedText(fromPosition, "~Skins~", coins[coin.from].effect)
end
return true
end
end
after which occurs ERROR in console.

Can You help me ?
I'm using otx 2.16 based on 0.3.7