• 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!

Item that gives tibia transferable coins

bolachapanco

Member
Joined
Aug 5, 2023
Messages
30
Reaction score
5
Location
Brazil
I have this script that when using the item it gives tibia coins, but I would like it to give tibia coins (transferable).
it's possible?

Lua:
local addCoins = Action()
function addCoins.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local coins = 25
  db.query("UPDATE `accounts` SET `coins` = `coins` + '" .. coins .. "' WHERE `id` = '" .. player:getAccountId() .. "';")
  player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received "..coins.." coins")
  item:remove(1)
  return true
end

addCoins:id(22118)
addCoins:register()
 
Solution
@Mateus Robeerto these are premium points from website system, he wants tibia coins from ingame store

@bolachapanco we need to know which engine you are using in order to help you
Yeah... before he didn't say anything about his mechanism... now he says it was Canary. However, I used this 'Premium Point' and went to test it, I clicked on an item and Tibia Coin appeared ingame. store tfs 1.5
Post automatically merged:

I went to take a look at this Canary and noticed that it has three types of coins: coins, coins_transferable and tournament_coins. I don't know which one makes Tibia Coins appear in the game through your store


Just test to see if it works...
Lua:
local addCoins = Action()

function addCoinsTransferable(player...
Do you want to click on the item to add it to your database? Tibia Coins, is that right?
Lua:
local addCoins = Action()

function addPremiumPoints(player, points)
    local accountId = player:getAccountId()
    db.query("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. accountId .. ";")
end

function addCoins.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local points = 25
    addPremiumPoints(player, points)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received " .. points .. " Tibia Coins")
    item:remove(1)
    return true
end

addCoins:id(22118)
addCoins:register()
I tested it and it worked here, all right.
 
Just change "premium_points" to "coins", it should work. But it was important that you inform the version of your server. Now, you mention Canary, but I don't have that information. Anyway, I think the script I sent should work. Just do the replacement as I mentioned.
 
@Mateus Robeerto these are premium points from website system, he wants tibia coins from ingame store

@bolachapanco we need to know which engine you are using in order to help you
Yeah... before he didn't say anything about his mechanism... now he says it was Canary. However, I used this 'Premium Point' and went to test it, I clicked on an item and Tibia Coin appeared ingame. store tfs 1.5
Post automatically merged:

I went to take a look at this Canary and noticed that it has three types of coins: coins, coins_transferable and tournament_coins. I don't know which one makes Tibia Coins appear in the game through your store


Just test to see if it works...
Lua:
local addCoins = Action()

function addCoinsTransferable(player, coins)
    local accountId = player:getAccountId()
    db.query("UPDATE `accounts` SET `coins_transferable` = `coins_transferable` + " .. coins .. " WHERE `id` = " .. accountId .. ";")
end

function addCoins.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local coins = 25
    addCoinsTransferable(player, coins)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received " .. coins .. " Transferable Coins")
    item:remove(1)
    return true
end

addCoins:id(22118)
addCoins:register()

Lua:
local addCoins = Action()

function addTournamentCoins(player, coins)
    local accountId = player:getAccountId()
    db.query("UPDATE `accounts` SET `tournament_coins` = `tournament_coins` + " .. coins .. " WHERE `id` = " .. accountId .. ";")
end

function addCoins.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local coins = 25
    addTournamentCoins(player, coins)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received " .. coins .. " Tournament Coins")
    item:remove(1)
    return true
end

addCoins:id(22118)
addCoins:register()

but I'm not sure... actually I don't really understand this canary
 
Last edited:
Solution
the script worked great, thanks a lot!
Post automatically merged:

Yeah... before he didn't say anything about his mechanism... now he says it was Canary. However, I used this 'Premium Point' and went to test it, I clicked on an item and Tibia Coin appeared ingame. store tfs 1.5
Post automatically merged:

I went to take a look at this Canary and noticed that it has three types of coins: coins, coins_transferable and tournament_coins. I don't know which one makes Tibia Coins appear in the game through your store


Just test to see if it works...
Lua:
local addCoins = Action()

function addCoinsTransferable(player, coins)
    local accountId = player:getAccountId()
    db.query("UPDATE `accounts` SET `coins_transferable` = `coins_transferable` + " .. coins .. " WHERE `id` = " .. accountId .. ";")
end

function addCoins.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local coins = 25
    addCoinsTransferable(player, coins)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received " .. coins .. " Transferable Coins")
    item:remove(1)
    return true
end

addCoins:id(22118)
addCoins:register()

Lua:
local addCoins = Action()

function addTournamentCoins(player, coins)
    local accountId = player:getAccountId()
    db.query("UPDATE `accounts` SET `tournament_coins` = `tournament_coins` + " .. coins .. " WHERE `id` = " .. accountId .. ";")
end

function addCoins.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local coins = 25
    addTournamentCoins(player, coins)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received " .. coins .. " Tournament Coins")
    item:remove(1)
    return true
end

addCoins:id(22118)
addCoins:register()

but I'm not sure... actually I don't really understand this canary
 
Back
Top