Phemus
Member
- Joined
- Jun 16, 2012
- Messages
- 149
- Solutions
- 2
- Reaction score
- 12
Hello, i have a script where fs you are certain level, you do not lose any items or skills level when you die, however, if you are above that level you lose everything like a normal character. This is the script
The problem is that when somebody dies when they are above that level, they lose like 10+ levels. It is becoming a major problem in my server. In config.lua the deathlosepercent is set at 10
I do not know if that has something to do with the problem.
I hope that someboy could help me. thank you!
Code:
local array = {
PLAYERLOSS_EXPERIENCE,
PLAYERLOSS_MANA,
PLAYERLOSS_SKILLS,
PLAYERLOSS_FIGHTING,
PLAYERLOSS_CONTAINERS,
PLAYERLOSS_ITEMS
}
local array2 = {
PLAYERLOSS_CONTAINERS,
PLAYERLOSS_ITEMS
}
function onPrepareDeath(cid, deathList)
if getPlayerLevel(cid) < 250 then
for i = 1, #array do
doPlayerSetLossPercent(cid, array[i], 0)
end
end
return true
end
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == SKILL__LEVEL and newLevel == 250 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'From this new level onwards you can lose experience, items and skills if you are killed.')
for i = 1, #array do
doPlayerSetLossPercent(cid, array[i], 10)
end
end
return true
end
function onLogin(cid)
registerCreatureEvent(cid, "lessdeath")
registerCreatureEvent(cid, "adv500")
return true
end
The problem is that when somebody dies when they are above that level, they lose like 10+ levels. It is becoming a major problem in my server. In config.lua the deathlosepercent is set at 10
Code:
deathLostPercent = 10
I hope that someboy could help me. thank you!