Soul Baker
New Member
- Joined
- Dec 8, 2015
- Messages
- 16
- Reaction score
- 0
local ITEM_GOLD_INGOT = 9971
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_GOLD_INGOT, effect = TEXTCOLOR_TEAL},
[ITEM_GOLD_INGOT] = {from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTGREEN}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) thenreturn false
end
local coin = coins[item.itemid]
if(not coin) thenreturn 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
<!-- Change gold -->
<action itemid="2148;2152;2160;9971" event="script" value="other/changegold.lua"/>
this script works for me but i want to add in gold nuggets. i want the crystal coins to turn into nugs. then nugs into gold ingots
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_GOLD_INGOT, effect = TEXTCOLOR_TEAL},
[ITEM_GOLD_INGOT] = {from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTGREEN}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) thenreturn false
end
local coin = coins[item.itemid]
if(not coin) thenreturn 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
<!-- Change gold -->
<action itemid="2148;2152;2160;9971" event="script" value="other/changegold.lua"/>
this script works for me but i want to add in gold nuggets. i want the crystal coins to turn into nugs. then nugs into gold ingots