also need help with this :
local config = {
[40407] = {changeTo = ITEM_CRYSTAL_COIN},
[ITEM_CRYSTAL_COIN] = {changeBack = 40407}
}
local changegold = Action()
function changegold.onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
local coin = config[item.itemid]
if not coin then
return false
end
if coin.changeTo and item.type == 1 then
item:remove()
player:addItem(coin.changeTo, 5)
elseif coin.changeBack then
item:transform(item.itemid, item.type - 5)
player:addItem(coin.changeBack, 1)
else
return false
end
return true
end
changegold:id(40407, 2160)
changegold:register()
It change 5cc to 1pirare coin, but when u have 1-4cc it makes them like 255cc.