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

Lua Player don't die, teleport

FKaupert

Joker Wolf
Joined
Nov 14, 2009
Messages
60
Reaction score
0
Location
Brazil
Hello people, i have a script where the player should not die but be teleported to the town.

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.
 
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 false
                   end

Don't worked...
 
Last edited:
stfu?
use onStatsChange like that:
if value >= getCreatureHealth(cid)
return false
end
 
Back
Top