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

Creatureevent script request Rep ++

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
am looking for script that if player in protection lvl (lvl 70-) died he no lose any items or Exp.
rep+
 
Last edited:
You need to edit sources :P
player.cpp [function: bool Player:onDeath()]
[CPP]
if(level <= g_config.getNumber(ConfigManager::PROTECTION_LEVEL))
{
setDropLoot(LOOT_DROP_NONE);
setLossSkill(false);
}
[/CPP]
Or well, im not good at lua but i guess this might work too:
LUA:
function onPrepareDeath(cid, deathList)
if(getPlayerLevel(cid) <= getConfigValue(protectionLevel)) then
doPlayerSetLossSkill(cid,false)
doCreatureSetDropLoot(cid, false)
return true
end
 
Last edited:
@Milice:
There is getConfigInfo() function. Use this instead of loading config.lua. Also you are missing function word before onPrepareDeath, you are missing one end and you need to use return true, else character will not die.
Haha i noticed, i just put something quick together so yeah.. xD fixed now :]

[Not tested but should work!]
 

Similar threads

Back
Top