• 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 Lua script problem!

RoHaN-OTs

RoHaN-OTs.com
Joined
Jul 28, 2010
Messages
1,594
Reaction score
82
Location
Sweden
My script (0.4)

Code:
function onPrepareDeath(cid, dl)
	if isPlayer(cid) and isInArea(getCreaturePosition(cid), {x=876,y=1010,z=9},{x=886,y=1020,z=9}) then
	    doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
	    doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
		doTeleportThing(cid, {x=886,y=1007,z=8})
		doSendMagicEffect({x=886,y=1007,z=8}, 10)
		return false
    end
	return true
end

I thought returning false in an onPrepareDeath event will prevent the user from dying.
Some fact's about this:
- I DO see the person being teleported, but after a second or so he disappears and dies
- The corpse appears if I don't handle the onDeath event with a false-return

Any idea why it doesn't work?

Thanks!
 
Back
Top