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

Lua Use scroll to give tibia coin

tommy91

Member
Joined
Oct 27, 2010
Messages
251
Reaction score
19
Location
Sweden
Hey! Ive been looking for a script that allows me to use the edited script "Premium Scroll" to be able to gain tibia store coins. I had it in my other older server but the script dont work on this one, its a Canary server, dont know the version really. Its on tibia 13.20. Also, my premium scroll does not work and i cannot use it. Is there a help/fix for this?
 
Solution
its a Canary server, dont know the version really. Its on tibia 13.20.
Hello tommy91!. You're not a new user and I'm a bit surprised that you write that you don't even know what version it is. Do not download servers from unknown sources, they have backdoors that in the future may cause that when your server is popular, someone will decide to destroy it, and you will not know how it happened. Try to use original distributions and redo it yourself, of course using github and forums if possible :)

[...] my premium scroll does not work and i cannot use it. Is there a help/fix for this?
If you search by filename and you don't have anything in your sources containing "premium_scroll.lua" or "premiumscroll.lua" then do it...
its a Canary server, dont know the version really. Its on tibia 13.20.
Hello tommy91!. You're not a new user and I'm a bit surprised that you write that you don't even know what version it is. Do not download servers from unknown sources, they have backdoors that in the future may cause that when your server is popular, someone will decide to destroy it, and you will not know how it happened. Try to use original distributions and redo it yourself, of course using github and forums if possible :)

[...] my premium scroll does not work and i cannot use it. Is there a help/fix for this?
If you search by filename and you don't have anything in your sources containing "premium_scroll.lua" or "premiumscroll.lua" then do it:
ex: carary/data-otservbr-global/scripts/actions/other

Create blank premiumscroll.lua, and inside:
Lua:
local config = {
    scrollId = 14758,
    premiumDays = 30,
}

local days = config.premiumDays
local premiumScroll = Action()
function premiumScroll.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    player:addPremiumDays(days)
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received " .. days .. " days of premium account. Please re-login!")
    item:remove(1)
    addEvent(function()
        if player:isPlayer() then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "In total you have " .. player:getPremiumDays() .. " premium account days.")
        end
    end, 2500)
    return true
end

premiumScroll:id(config.scrollId)
premiumScroll:register()

Save it and restart server / reload scripts via GOD. Should work now.

[...] Ive been looking for a script that allows me to use the edited script "Premium Scroll" to be able to gain tibia store coins.
The script will be practically identical to the one above, except that you need to change the item id, change the days to the number of Tibia coins, and make a query (instead addPremiumDays) to the database. I would skip the second message to the player in this case.
Code:
scrollId = ur new scroll id, 
local coins = 250
db.query("UPDATE `accounts` SET `coins` = `coins` + '" .. coins .. "' WHERE `id` = '" .. player:getAccountId() .. "';")
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have received "..coins.." Tibia Coins.")
 
Solution
Back
Top