Fala galera hoje estou aki trazendo um script que ira proteger o player ate um certo lvl a exp e o magic level vamos lá .
vá em data / creaturescripts / scripts / renome algum arquivo para levelprotection.lua é adicione .
function onDeath(cid, corpse, deathList) local level = 7121727 -- até que level irá proteger o player de não perder exp & ml if isPlayer(cid) and getPlayerLevel(cid) <= level then doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) end return true end
em creaturescripts.xml adicione.
<event type="death" name="ProtecExp" event="script" value="levelprotection.lua"/>
em data / creaturescripts / scripts / login.lua adicione .
registerCreatureEvent(cid, "ProtectExp")