local from, to = {x=1, y =1, z=1}, {x=1, y =1, z=1}local newpos = {x=1, y =1, z=1}function onStatsChange(cid, attacker, type, combat, value) if isInRange(getPlayerPosition(cid), from, to) and type == STATSCHANGE_HEALTHLOSS and value >= getCreatureHealth(cid) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) doTeleportThing(cid, newpos) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) return false end return trueend
<event type="statschange" name="MorteTp" event="script" value="NOMEDOARQUIVO.lua"/>
No login.lua: registerCreatureEvent(cid, "MorteTp")