• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

RevScripts convert action to revscripts

matthew123456

New Member
Joined
Aug 24, 2013
Messages
121
Reaction score
3
Lua:
local config = {
   idcoin = 24774
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
   local player = Player(cid)
   local item = Item(item.uid)
   if player:getItemCount(config.idcoin) > 0 then
       local coinplayer = player:getCoinsBalance()+item:getCount()
       player:getPosition():sendMagicEffect(15)
       item:remove()
       player:setCoinsBalance(coinplayer)
   else
       player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to carry tibia coins in your backpack.")
   end
   return true
end

could someone pleas convert to revscripts thanks in advance
 
Lua:
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 tibia coins in your backpack.")
    end


storeCoin:id(24774)
storeCoin:register()

Working for me. But u can use them even if they are not in your bp.
 
if still needed, try;
Lua:
local config = {
    coinId = 2328,
    effect = 15
}

local action = Action()
function action.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getItemCount(config.coinId) > 0 then
        local playerCoins = player:getCoinsBalance() + item:getCount()
        player:getPosition():sendMagicEffect(config.effect)
        player:setCoinsBalance(playerCoins)
        item:remove()
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have to carry tibia coins in your backpack.")
    end
    return true
end

action:id(config.coinId)
action:register()
 
Back
Top