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

[Request] Player get teleported when he dies

Rizzla

Donator / Photoshop
Joined
Sep 7, 2008
Messages
1,335
Reaction score
2
Location
Sweden -> Stockholm
When a player dies, he will not die but they will just get teleported to temple instead of dying. But only until level 50! Players will not lose levels, eq, skills or anything.

Can anyone give me this script?
 
Edited JDB's script:
Lua:
function onPrepareDeath(cid, deathList)
	local cfg = {
		level = 50,
		msg = "You were safely teleported."
	}
	if(getPlayerLevel(cid) <= cfg.level) then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, cfg.msg)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
	end
	return true
end
EDIT: doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) ain't working in TFS 0.3.6 =/! Why?
 
Last edited:
Code:
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
 
Code:
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
Yes, I did that the first time, but getCreatureHealth(cid) = 0 so you can remove it. By the way, why that function isn't working?
 
Back
Top