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, 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
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, 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
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)
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)
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)
elseif item.itemid == ITEM_CRYSTAL_COIN then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
else
return false
end
return true
end
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)
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)
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)
elseif item.itemid == ITEM_CRYSTAL_COIN then
doChangeTypeItem(item.uid, item.type - 1)
doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX)
else
return FALSE
end
return TRUE
end
Ok then, Go into your action folder and move any gold changing script to a different folder that you know you will be able to find it if you need it again. and open a new notepad document and copy this in it
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) 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) 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) elseif item.itemid == ITEM_CRYSTAL_COIN then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX) else return FALSE end return TRUE end
And save it as the same name you had it b4 [name here].lua
Make sure it saves as a .lua document or it won't work. If its a .txt it will not work
ALSO double click the actions.xml to open it up and double check to see that the name matches the one of the .lua file.
I do not know how your sever folders are set up other wise I would give you a more descriptive instructions on changing this, you said your a bit new to this but I do not take you as an idiot.
If you can not follow these instructions I can make a quick vid for you showing you how to change this.
If the script doesn't work in general please tell me and I can think of another way to fix your problem