• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Bless problem

natanl2

New Member
Joined
May 4, 2012
Messages
28
Reaction score
0
Hello. I'm owner of a Tibia OTserver 8.6, REV 0.4 and I'm having a big problem... The bless rate isn't 100%, sometimes when the player die (even with bless), he drop... Anyone know how to fix it?

Config.lua - Bless rates

Code:
-- Blessings
blessings = true
blessingOnlyPremium = false
blessingReductionBase = 30
blessingReductionDecrement = 5
eachBlessReduction = 8

Bless.lua - Talkaction

Code:
-- !blessing by artofwork
local bless = {1, 2, 3, 4, 5}
local cost = 50000
local maxlevel = 50000

function onSay(cid, words, param)
local lvl = getPlayerLevel(cid)
local new_cost = (lvl * cost) / 500
local target = getPlayerGUID(cid)


        for i = 1, table.maxn(bless) do
                if(getPlayerBlessing(cid, bless[i])) then
                        doPlayerSendCancel(cid, "Voce ja tem bless.")
                        return TRUE
                end
        end
       
        if (getPlayerLevel(cid) >= maxlevel)  then
                if(doPlayerRemoveMoney(cid, new_cost) == TRUE) then
                        for i = 1, table.maxn(bless) do
                        doPlayerAddBlessing(cid, bless[i])
                        doSendAnimatedText(getThingPos(cid), "Abencoado", math.random(1, 255))
                end
                else
                doPlayerSendCancel(cid, "Voce precisa de "..new_cost.." gps.")
                end
       
        elseif(getPlayerLevel(cid) < maxlevel) then
                if(doPlayerRemoveMoney(cid, cost) == TRUE) then
                        for i = 1, table.maxn(bless) do
                        doPlayerAddBlessing(cid, bless[i])
                        end
                        doSendAnimatedText(getThingPos(cid), "Abencoado", math.random(1, 255))
                else
                        doPlayerSendCancel(cid, "Voce precisa de "..cost.." gps.")
                end
        end
        return FALSE
end

Thanks!
 
Yes, have this bug is many TFS's too, i reccomend u to give one Amulet of Loss or try to put "Twist of Fate" too.
 
Code:
function onSay(cid, words, param)
 
    local cost, level, newcost = 50000, 50000, ((getPlayerLevel(cid) * cost) / 500)
    for i = 1, 5 do
        if getPlayerBlessing(cid, [i]) ~= 0 then
            doPlayerSendCancel(cid, "Voce ja tem bless.")
        end
    end
 
    for i = 1, 5 do
        if getPlayerLevel(cid) >= level then
            if doPlayerRemoveMoney(cid, newcost) == TRUE then
                doPlayerAddBlessing(cid, i)
                doSendAnimatedText(getThingPos(cid), "Abencoado", math.random(1, 255))
            else
                doPlayerSendCancel(cid, "Voce precisa de "..new_cost.." gps.")
            end
        elseif getPlayerLevel(cid) < level then
            if doPlayerRemoveMoney(cid, cost) == TRUE then
                doPlayerAddBlessing(cid, i)
                doSendAnimatedText(getThingPos(cid), "Abencoado", math.random(1, 255))
            else
                doPlayerSendCancel(cid, "Voce precisa de "..cost.." gps.")
            end
        end
    end
    return false
end
 
Last edited:
Back
Top