Hello people, i have a script where the player should not die but be teleported to the town.
I registered it in login.lua and added in creaturescripts.xml.
Code:
function onDeath(cid, corpse, killer)
if isPlayer(cid) and isPlayer(killer) then
doCreatureAddHealth(cid,getCreatureMaxHealth(cid))
doCreatureAddMana(cid,getCreatureMaxMana(cid))
doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)))
end
return TRUE
end
I registered it in login.lua and added in creaturescripts.xml.