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

!bless command error, get people level 1 when they die

Buddex

New Member
Joined
Feb 25, 2012
Messages
35
Reaction score
1
Location
Gradiska-Republic of Srpska
I did search on forum and tested about 10 bless scripts. I have found only 1 which works for me here: http://otland.net/threads/bless-makes-people-level-1-when-they-die.204778/ But.. I have only one little problem when I buy !bless once, i am blessed all time in game, its like forever bless. How to change when I die then I need to buy again !bless. :) PEaCe! :D

My bless.lua (talkaction)


local config = {
blessStorage = 12345, -- The storage value you will use to store a players blessings
blessCost = 50000 -- The price of blessings
}
function onSay(cid, words, param)
if(getCreatureStorage(cid, config.blessStorage) <= 0) then
if(doPlayerRemoveMoney(cid, config.blessCost)) then
doCreatureSetStorage(cid, config.blessStorage, 1)
doCreatureSay(cid, "You are now blessed by the Five Gods!", 19)
doSendMagicEffect(getPlayerPosition(cid), 49)
else
doPlayerSendCancel(cid, "You need ".. config.blessCost .."gp to buy blessings.")
end
else
doPlayerSendCancel(cid, "You are already blessed.")
end
return true
end
 
Try this one,
Code:
function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 50000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 5 crystal coin to get blessed!")
        end
    end    
    return 1
end
 
Try this one,
Code:
function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 50000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 5 crystal coin to get blessed!")
        end
    end   
    return 1
end


this one will work 100% with u.. :)
 
Guys wont work, when I die player goes on 1 lvl. But thanks for try help. :)
Here is my config.lua
blessingOnlyPremium = false
blessingReductionBase = 30
blessingReductionDecreament = 5
eachBlessReduction = 8
 
Last edited:
Did you try my script? Works perfectly when I use it, try to make a new char and test it with them and did you restart your server
Yes dude I test your script, i restart ot and make new character and when player die he dont lose items that is good, but he downgrade on level 1, if he was 200 lvl he down at 1. If lvl 300 again down on 1lvl. Understand me dude, when player die he is 1 level. :)
 
I've looked to the topic you've posted link to.
If you have added it to the server:
Code:
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)

If you have in config deathLostPercent = 10
then this script makes the loss 10 times 10 which equals 100% loss of exp.
Isn't that a reason of coming back to 1lv?
 
I've looked to the topic you've posted link to.
If you have added it to the server:
Code:
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)

If you have in config deathLostPercent = 10
then this script makes the loss 10 times 10 which equals 100% loss of exp.
Isn't that a reason of coming back to 1lv?

Dude I have this in my login.lua, did I must change deathLostPercent ?
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
 
I'm not an expert but you might try to set there loss * 10 to loss * 1 and see what happens, if nothing changes, I was wrong and I didn't help you.
 
Try this one,
Code:
function onSay(cid, words, param)
    if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
        doPlayerSendCancel(cid,'You have already got one or more blessings!')
    else
        if doPlayerRemoveMoney(cid, 50000) == TRUE then
            doPlayerAddBlessing(cid, 1)
            doPlayerAddBlessing(cid, 2)
            doPlayerAddBlessing(cid, 3)
            doPlayerAddBlessing(cid, 4)
            doPlayerAddBlessing(cid, 5)
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have been blessed by the gods!')
        else
            doPlayerSendCancel(cid, "You need 5 crystal coin to get blessed!")
        end
    end   
    return 1
end
for i = 1,5 do
 
I'm not an expert but you might try to set there loss * 10 to loss * 1 and see what happens, if nothing changes, I was wrong and I didn't help you.
Bro I was change i put PLAYERLOSS_EXPERIENCE, loss * 1)
and same, again downgrade on 1 lvl.
for i = 1,5 do
Dude what you mean i = 1,5 can you more explain :)
 
Back
Top