• 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
 
Or just put this mod in your mod folder...

Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Respawn_Module" version="2.0" author="Syntax" contact="[email protected]" enabled="yes">
    <config name="respawn_config"><![CDATA[
        config = {
			masterpos = false, -- set to true if you want them teleported to their home town
			townid = 0, -- if masterpos is false then set for custom town or set to 0 for custom position
			position = {x = 1231, y = 988, z = 8}
        }
 ]]></config>
	<event type="login" name="Respawn_login" event="buffer"><![CDATA[
		registerCreatureEvent(cid, "Respawn_status")
]]></event>
	<event type="statschange" name="Respawn_status" event="script"><![CDATA[
	domodlib('respawn_config')
		function onStatsChange(cid, attacker, type, combat, value)
			if type == 1 and getCreatureHealth(cid) <= value then
				pos = config.position
				if(config.masterpos)then
					pos = getPlayerMasterPos(cid)
				elseif config.townid > 0 then
					pos = getTownTemplePosition(config.townid)
				end
				doTeleportThing(cid, pos)
				doCreatureAddHealth(cid, getCreatureMaxHealth(cid)) 
				return false
			end
			return true
		end
]]></event>
</mod>

This mod doesn't work for 0.2 right?:huh:
 
Back
Top