• 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 Tp after death

Gothric

New Member
Joined
Feb 6, 2010
Messages
264
Reaction score
1
if player death he see an window "you are death.." , i dont want it :) i want to fix that when the player death he get tp to the x y z place and he get full hp :) i already use this script but it doesnt work perfect :S I get tp but i dont get full hp :s its mean that i get tp but i am dead xd


PHP:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
doCreatureAddHealth(cid, 9999)
doCreatureAddHealth(cid, 10, getCreatureMaxHealth(cid))
local pozycja = {x=1369, y=1225, z=7}
doTeleportThing(cid, pozycja)
end
 
i remember a old war serv that was like that, you get killed you dont get that you are dead message instead you get to the temple and get full hp
 
SunnShine u suggest that not ondeath but onPrepareDeath
but what i should write in creaturescript.xml??
maybe anyone see bug in my script??
 
This will not work, if you going to use this, you will need to script a long shit, like you will teleport to temple, but will lose 10% of your eq and shit, thats a long script.
 
Lua:
local t = {x=1369, y=1225, z=7}  -- tempel POS.
 	 function onPrepareDeath(cid, killer) 
doTeleportThing(cid, .. t ..) 
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are now in tempel!")
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))  
   return TRUE
  end

idk ^^
 
Lua:
local t = {x=1369, y=1225, z=7}  -- tempel POS.
 	 function onPrepareDeath(cid, killer) 
doTeleportThing(cid, .. t ..) 
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are now in tempel!")
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))  
   return TRUE
  end
offtopic: Unread Today, 13:37

ontopic: i dont know sorry
idk ^^
 
Lua:
function onPrepareDeath(cid, killer) 
	doTeleportThing(cid, getPlayerMasterPos(cid))
	doCreatureAddHealth(cid, getCreatureMaxHealth(cid))  
	return false
end

Lua:
function onStatsChange(cid, attacker, type, combat, value)
	if type == 1 and getCreatureHealth(cid) <= value then
		doTeleportThing(cid, getPlayerMasterPos(cid))
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) 
		return false
	end
	return true
end

pick one
 
better to use a pos insted of masterPos.. then he can use a better for a server with a tempel one for ex. new players and one for dies
 
Lua:
local temple() = {x=1369, y=1225, z=7}  -- tempel POS.
function onPrepareDeath(cid, killer) 
        doTeleportThing(cid, tempel())
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid))  
        return false
end
 
Back
Top