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

When the player dies I don't want to decrease the level and magic level 8.6 tfs 0.4 How can I work this

Zembawar

Banned User
Joined
Nov 8, 2019
Messages
14
Reaction score
0
When the player dies I don't want to decrease the level and magic level 8.6 tfs 0.4 How can I work this
 
You can auto add blessings in login.lua like this
Lua:
        doPlayerAddBlessing(cid, 1)
        doPlayerAddBlessing(cid, 2)
        doPlayerAddBlessing(cid, 3)
        doPlayerAddBlessing(cid, 4)
        doPlayerAddBlessing(cid, 5)
or add this
Lua:
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_MAGIC, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
You can change in config.lua
deathLostPercent to 0
and you can update through your DB like this
SQL:
UPDATE `players` SET `loss_experience`=0;
UPDATE `players` SET `loss_mana`=0;
UPDATE `players` SET `loss_skills`=0;
Any of the solutions above should work.
 
Which one isn't working? I posted 4 solutions above and here are 2 more, Try by adding this
Add data\creaturescripts\creaturescripts.xml
XML:
<event type="preparedeath" name="DeathProtection" event="script" value="blessingdeath.lua"/>
Then data\creaturescripts\scripts\login.lua add
Lua:
registerCreatureEvent(cid, "DeathProtection")
and create data\creaturescripts\scripts\deathprotection.lua then paste this inside
Lua:
function onPrepareDeath(cid)
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
doPlayerSetLossPercent(cid, level, 0)
    doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0)
end
return true

Or only paste this to your data\creaturescripts\scripts\login.lua
Lua:
if isPlayer(cid) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
doPlayerSetLossPercent(cid, level, 0)
    doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0)
 doSavePlayer(cid)
end
return true
 
You tried the other solutions of Deatthraz and itachi? I think the vocations.xml one should work.
So instead of ignoring their replies I suggest you testing them or atleast if you already tested write it so we/they know and please try to post a better quality screenshots instead of those ones because its too hard for me to read, you can simply use Windows Snipping Tool.
 
Back
Top