Jump to content
Sign in to follow this  
Majesty

[Revscriptsys] Change Coin

Recommended Posts

Majesty    1,755
Majesty
Citar

Nome: [Revscriptsys] Change Coin

Versão: [10.98+] // Compatível com TFS 1.3 / OTServBR-Global

Tipo do script: Action

Em data/scripts/actions, crie um arquivo change_coin.lua com o código abaixo:

Spoiler

local changeCoin = Action() 

local config = {
    [2148] = {changeTo = 2152},
    [2152] = {changeBack = 2148, changeTo = 2160},
    [2160] = {changeBack = 2152}
}

function changeCoin.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

changeCoin:id(2148,2152,2160)
changeCoin:register()

 

 

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×