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

Item Experience Protection

GOD Esteve

New Member
Joined
May 18, 2011
Messages
87
Reaction score
1
Hello guys,

How the title says i whant to make one item that when the players is equipeed with this item he don`t lose nothing of experience, containers, etc...

What i made stay like that

function onPrepareDeath(cid, lastHitkiller, mostDamagekiller)
if(getPlayerSlotItem(cid, 2).itemid == 2196) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
else
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 100)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 100)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 100)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 100)
end
return TRUE
end

This script is working if use only the item, but if the players have bless and use this item when he die goes to level 1.
login.lua have a registre of preparedeath event.
 
If he doesnt have the item he loses all the stuff that you added after else.
It's not a bug it's your super weird script.
Remove the else stuff and you're good to go.
 
Without else also don`t work i already test this.
The problem is while using item and have bless that is making he goes to level 1.
 
Enough said. You were pointed towards the solution with a logical reason.
Find your way through, there's a ton of similar scripts and tutorials.

Have item equipped? > don't lose anything
Don't have item equipped? > lose 100%of mana, skills, exp, items, bags

That's your script tl'dr.
 
So i make more tests

function onPrepareDeath(cid, lastHitkiller, mostDamagekiller)
if(getPlayerSlotItem(cid, 2).itemid == 2196) then

doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_CONTAINERS, 0)
doPlayerSetLossPercent(cid, PLAYERLOSS_ITEMS, 0)
end
return TRUE
end

Die only with item, works don`t lose nothing
Die only with bless, works the bless, lose a small amount of experience and don`t lose item
Die with item+bless, don`t lose nothing but goes to level 1
Die without anything lose normal
 
Back
Top