Jump to content
Majesty

[Revscriptsys] Store Coin

Recommended Posts

Majesty    1,755
Majesty
Citar

Nome: [Revscriptsys] Store Coin

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

Tipo do script: Action

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

Spoiler

local storeCoin = Action()

function storeCoin.onUse(player, item, fromPosition, target, toPosition, isHotkey)
        local storeCoin = Player(cid)
        local storeCoin = player:getCoinsBalance()+item:getCount()
        player:getPosition():sendMagicEffect(15)
        item:remove()
        player:setCoinsBalance(storeCoin)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to carry store coins in your backpack.")
    end

storeCoin:id(24774)
storeCoin:register()

 

 

Share this post


Link to post
lepiigor    16
lepiigor

Se para alguém não funcionar, este vai funcionar

 

local tibiaCoin = Action()

function tibiaCoin.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local coins = 1 -- quantidade de coins que o item vai dar
  db.query("UPDATE `accounts` SET `coins` = `coins` + '" .. coins .. "' WHERE `id` = '" .. player:getAccountId() .. "';")
  player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received "..coins.." Tibia Coin")
  item:remove(1)
  return true
end

tibiaCoin:id(24774)
tibiaCoin:register()

 

Share this post


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

    No registered users viewing this page.

×