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

nerver lose blessings

Simonp1512

DBhispano
Joined
Feb 22, 2009
Messages
62
Reaction score
3
hi ppl i have an error with my server, when some player die by other player that means pk action, the player who dies no lose bless no matter how many times i kill that player that player never lose the blessings

i got this code on the forum i use tfs 1.x

Lua:
function onSay(cid)

    local player = Player(cid)
    local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7

    if player:getBlessings() == 5 then
                player:sendCancelMessage("You already have been blessed!", cid)
            elseif player:removeMoney(totalBlessPrice) then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!")
                for b = 1, 8 do
                    player:addBlessing(b, 1)
                end
                player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)

            else
                player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid)
            end
end


oh and that scrip never get the money when i say !bless i mean always is free xd
 
Solution
Post your data\creaturescripts\scripts\login.lua and check if you have any other onlogin scrip that might add blessing to players.
Talkaction script looks good but maybe try this one too.
Lua:
function onSay(cid)

    local player = Player(cid)
    local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7
    if(not(isPlayerPzLocked(cid))) then
    if player:getBlessings() == 5 then
                player:sendCancelMessage("You already have been blessed!", cid)
            elseif player:removeMoney(totalBlessPrice) then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!")
                for b = 1, 5 do
                    player:addBlessing(b, 1)...
Post your data\creaturescripts\scripts\login.lua and check if you have any other onlogin scrip that might add blessing to players.
Talkaction script looks good but maybe try this one too.
Lua:
function onSay(cid)

    local player = Player(cid)
    local totalBlessPrice = getBlessingsCost(player:getLevel()) * 5 * 0.7
    if(not(isPlayerPzLocked(cid))) then
    if player:getBlessings() == 5 then
                player:sendCancelMessage("You already have been blessed!", cid)
            elseif player:removeMoney(totalBlessPrice) then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of eight gods!")
                for b = 1, 5 do
                    player:addBlessing(b, 1)
                end
                player:getPosition():sendMagicEffect(CONST_ME_HOLYAREA)
              
            else
                player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid)
            end
    else
        player:sendCancelMessage("You can't buy bless while you are in a battle.")
    end
end
 
Solution
Edit---

i use your code and now the players lose blessing when die by pk but any way to get pay when say !bless? i don't know the function is a free bless xD
 
Last edited:
Back
Top