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

Solved Blessing book Script ?

jimmydunphy

New Member
Joined
Aug 9, 2007
Messages
68
Reaction score
3
Location
Nova Scotia Canada
I'm using tfs 1.2 and wondering if anyone could tell me how to make a book of infinite blessings? One click = 5 blessing but but never runs out? Ty!
 
make your item of choice give the player all 5 blessings and a storage, then edit login.lua so players with that storage gets all 5 blessings on login
 
Wow, when i was beginner. I was able to edit scripts...

Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    for i = 1, 5 do
        if player:hasBlessing(i) then
            return true
        end

        player:addBlessing(i)
    end

    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by the gods.")
    player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
    return true
end
 
REMOVED already anwsered the time i was writing.
;S

Printer Just remove the Return true from the for loop
:)
if he has one of the bless the script will stop.

i deleted my script because i saw ur and mine was Too big ;'(
here it is

HTML:
<!-- YouBlessScript ( Something) -->
<action itemid="XXX" script="other/YouFileName.lua" />
PHP:
local config = {
    [1] = {blessId = 4, text = 'The Spark of the Phoenix'},
    [2] = {blessId = 2, text = 'The Embrace of Tibia'},
    [3] = {blessId = 1, text = 'The Spiritual Shielding'},
    [4] = {blessId = 3, text = 'The Fire of the Suns'},
    [5] = {blessId = 5, text = 'The Wisdom of Solitude'}
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)

    for i=1,5 do
        local useItem = config[i]
        if player:hasBlessing(useItem.blessId) then
--            player:say('You already possess this blessing.', TALKTYPE_MONSTER_SAY)
        else
            player:addBlessing(useItem.blessId)
--            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, useItem.text .. ' protects you.')
            player:getPosition():sendMagicEffect(CONST_ME_LOSEENERGY)
        end
    end
   
    return true
end
 
Last edited:
REMOVED already anwsered the time i was writing.
;S

Printer Just remove the Return true from the for loop
:)
if he has one of the bless the script will stop.
I know, but if player die. He lose all his bless? Else he should check if not player:hasBlessing(i) then, it should set those which he does not have.
 
I know, but if player die. He lose all his bless? Else he should check if not player:hasBlessing(i) then, it should set those which he does not have.
that mens One who has one bless and never dead cant use it.
So ur script should be ( just my View i may be wrong )
PHP:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    for i = 1, 5 do
        if  not player:hasBlessing(i) then
            player:addBlessing(i)
        end
    end

    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by the gods.")
    player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
    return true
end
 
Back
Top