Action [TFS 1.2] Tibia Coin.

Discussion in 'Actions, MoveEvents & TalkActions' started by Methemia, Mar 22, 2017.

  1. Methemia

    Methemia Member

    Joined:
    Feb 1, 2015
    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Code (Text):
    1. <action itemid="24774" script="tibiacoin.lua" />
    data/actions/scripts/tibiacoin.lua
    Code (Text):
    1. local config = {
    2.    idcoin = 24774
    3. }
    4.  
    5. function onUse(cid, item, fromPosition, itemEx, toPosition)
    6.    local player = Player(cid)
    7.    local item = Item(item.uid)
    8.    if player:getItemCount(config.idcoin) > 0 then
    9.        local coinplayer = player:getCoinsBalance()+item:getCount()
    10.        player:getPosition():sendMagicEffect(15)
    11.        item:remove()
    12.        player:setCoinsBalance(coinplayer)
    13.    else
    14.        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to carry tibia coins in your backpack.")
    15.    end
    16.    return true
    17. end
     
  2. KucakMarcin

    KucakMarcin New Member

    Joined:
    Apr 23, 2013
    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    lel.jpg

    TFS 1.2 - 10.98
     
  3. Imfreezing

    Imfreezing Krossa Kapitalismen

    Joined:
    Jun 7, 2012
    Messages:
    988
    Likes Received:
    75
    Best Answers:
    0
    You're missing an essential lib file.
     

Share This Page

Loading...