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

C++ Error with bless

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
549
Solutions
1
Reaction score
58
Location
Lo Mochis, Sinaloa
Lua:
local buybless = TalkAction("/bless")

function buybless.onSay(player, words, param)
     if player:hasBlessing(1) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You are already blessed.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    else
        local playerBlessCost
        if player:getLevel() < 50 then
            -- under level 50 it's free
            playerBlessCost = 0
        else
            -- from level 50 cost 36k + 200 gold coins for each level
            -- limit to maximum 120k
            playerBlessCost = player:getLevel() * 100
        end

        if player:removeMoney(playerBlessCost) then
            for blessId = 1, 5 do
                player:addBlessing(blessId)
            end

            player:sendCancelMessage("You received all blessings for " .. playerBlessCost .. " gold coins.")
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You do not have enough money. Bless on your level costs " .. playerBlessCost .. " gold coins.")
            player:getPosition():sendMagicEffect(CONST_ME_POFF)
        end
    end

  return true
end

buybless:separator(" ")
buybless:register()
blesserror.png
 
Lua:
local buybless = TalkAction("/bless")

function buybless.onSay(player, words, param)
     if player:hasBlessing(1) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You are already blessed.")
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
    else
        local playerBlessCost
        if player:getLevel() < 50 then
            -- under level 50 it's free
            playerBlessCost = 0
        else
            -- from level 50 cost 36k + 200 gold coins for each level
            -- limit to maximum 120k
            playerBlessCost = player:getLevel() * 100
        end

        if player:removeMoney(playerBlessCost) then
            for blessId = 1, 5 do
                player:addBlessing(blessId)
            end

            player:sendCancelMessage("You received all blessings for " .. playerBlessCost .. " gold coins.")
            player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You do not have enough money. Bless on your level costs " .. playerBlessCost .. " gold coins.")
            player:getPosition():sendMagicEffect(CONST_ME_POFF)
        end
    end

  return true
end

buybless:separator(" ")
buybless:register()
View attachment 62418
Update your tfs version, I guess?

I copy pasted it on tfs 1.4, and it worked no problem.

Untitled.pngUntitled.png
 
How can I update my tfs leaving my own files already modified? for example I have set the monster level system
Follow Evil Puncker's link, make the changes, and recompile your source code.

--
If you're using a modified source code, you need to stay up-to-date with the original source code and install any of the bug fixes / upgrades manually.

🤷‍♀️
 
The script does work ang i get blessings, but when i die i still lose experience.
Could someone explain what i'm doing wrong? :D
Tfs 1.5 nekiro downgrade 7.72
 
The script does work ang i get blessings, but when i die i still lose experience.
Could someone explain what i'm doing wrong? :D
Tfs 1.5 nekiro downgrade 7.72
blessing doesn't prevent experience loss, it just reduce it and on 7.72 it didn't even prevented item loss
 
blessing doesn't prevent experience loss, it just reduce it and on 7.72 it didn't even prevented item loss
Yes but still you can change the value of loss, the problem is when i die i still have blessings that i bought, like it's not reseting or something.
I wanna make something like AOL but with prevent loss items and experience, any ideas?
 
Back
Top