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

Lua Blessings

Djivar

AKA Wickedviruz
Joined
Sep 28, 2009
Messages
1,641
Reaction score
19
Location
Sweden,edsbyn
Okey, as i said, my blessings is fucked up, and i dont know why..
it worked before and we fixed some other things and after a wile
the bless just fucked up :S when you have blessings you lose all level.
It dosent meather wich lvl you are if you are 500 och if you are lvl 2, you still loose all level down to level 1, and here is all the scripts

all bless in config.lua
Lua:
        blessingOnlyPremium = "true"
        blessingReductionBase = 30
        blessingReductionDecreament = 5
        eachBlessReduction = 20
and
Lua:
        deathLostPercent = 10

talk actions.xml:
Code:
	<talkaction words="!blessings" event="script" value="bless.lua"/>
and bless.lua
Lua:
  function onSay(cid, words, param, channel)
        if getPlayerBlessing(cid, 5) == FALSE then
                if getPlayerMoney(cid) >= 300000 then
                        for i = 1,5 do
                                doPlayerAddBlessing(cid, i)
                        end
                        doSendMagicEffect(getCreaturePosition(cid), 39)
                        doPlayerRemoveMoney(cid, 300000)
                        doPlayerSendTextMessage(cid, 22, "You have been blessed by the gods!")
                else
                        doPlayerSendCancel(cid, "You don't have enough money.")
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
                end
        else
                doPlayerSendCancel(cid, "You have already been blessed.")
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        end
return true
end

and in creaturescripts/login.lua
Code:
function onLogin(cid)
    local loss = getConfigValue('deathLostPercent')
    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
    end

and in creaturescripts.xml
Code:
<creaturescripts>
	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>

Rep+ for helping and fixing it!

Well i got it to work after a wile so they didnt loose any leve, but after a wile they loose like 90% of the level if they have bless and i havent tuch it :S
 
Last edited:
Try to change in config.lua to:

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

Code:
	deathLostPercent = 13

I think work.
 
so blessings tinyint(2) ?

Column datatype has nothing to do with this. This column is used to store which blessings the player has, in a bitwise way.

BLESS1 = 1
BLESS2 = 2
BLESS3 = 4
BLESS4 = 8
BLESS5 = 16

if the player has all 5 blessings, it will be set to 1+2+4+8+16 = 31
 
Try to change in config.lua to:

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

Code:
	deathLostPercent = 13

I think work.

this worked first then i removed to the things i had before and edited and they didnt work, and when i changed back to this it didnt work >.<


neverminde soveld it! :)
 
Back
Top