Przemyslaw1101
Member
- Joined
- Feb 16, 2017
- Messages
- 55
- Solutions
- 2
- Reaction score
- 9
Hey, anyone write script with changing gold for TFS 1.3 with revscript? Please share if u have any <3
local config = {
[ITEM_GOLD_COIN] = {changeTo = ITEM_PLATINUM_COIN},
[ITEM_PLATINUM_COIN] = {changeBack = ITEM_GOLD_COIN, changeTo = ITEM_CRYSTAL_COIN},
[ITEM_CRYSTAL_COIN] = {changeBack = ITEM_PLATINUM_COIN}
}
local changeGold = Action()
function changeGold.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local coin = config[item:getId()]
if coin.changeTo and item.type == 100 then
item:remove()
player:addItem(coin.changeTo, 1)
elseif coin.changeBack then
item:remove(1)
player:addItem(coin.changeBack, 100)
else
return false
end
return true
end
changeGold:id(2148, 2152, 2160)
changeGold:register()
/data/scripts/actions/tools/gold_converter.lua
local config = {
[ITEM_GOLD_COIN] = {changeTo = ITEM_PLATINUM_COIN},
[ITEM_PLATINUM_COIN] = {changeBack = ITEM_GOLD_COIN, changeTo = ITEM_CRYSTAL_COIN},
[ITEM_CRYSTAL_COIN] = {changeBack = ITEM_PLATINUM_COIN}
}
local changeGold = Action()
function changeGold.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local coin = config[item:getId()]
if coin.changeTo and item.type == 100 then
item:remove()
player:addItem(coin.changeTo, 1)
elseif coin.changeBack then
item:remove(1)
player:addItem(coin.changeBack, 100)
else
return false
end
return true
end
changeGold:id(2148, 2152, 2160)
changeGold:register()
MyAcc is a website for a server.Does it work for MyAcc Server?