• 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
 
syntax ur first script doesnt work :d and i havent got any bugs in console :d i think about preparedeath

on StatsChange in console i can read

[13/06/2010 11:19:50] [Warning - Event::loadScript] Event onStatsChange not found (data/creaturescripts/scripts/tpondeath.lua)

_____________
Propably the best script gave me Wibben :d i think about second one , i got tp and i havent got THIS FUCKEN WINDOW " you are death"
but i still have 0 hp and i cannot move becouse it still tp me :d u undersntad? i hope yes :d please help me :d rep++ from all accounts
 
syntax ur first script doesnt work :d and i havent got any bugs in console :d i think about preparedeath

on StatsChange in console i can read

[13/06/2010 11:19:50] [Warning - Event::loadScript] Event onStatsChange not found (data/creaturescripts/scripts/tpondeath.lua)

_____________
Propably the best script gave me Wibben :d i think about second one , i got tp and i havent got THIS FUCKEN WINDOW " you are death"
but i still have 0 hp and i cannot move becouse it still tp me :d u undersntad? i hope yes :d please help me :d rep++ from all accounts


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
 
local temple() = {x=1369, y=1225, z=7} -- tempel POS.

this () is important?? becouse i have bugs in console and i must delet eit
 
yes & no.

Lua:
local pos = {x=1369, y=1225, z=7}  -- tempel POS.
function onPrepareDeath(cid, killer) 
        doTeleportThing(cid, pos)
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid))  
        return false
              else
return true
  end
end
 
[01/05/2010 19:42:59] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/tpondeath.lua:6: 'end' expected (to close 'function' at line 2) near 'else'
[01/05/2010 19:42:59] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/tpondeath.lua)
[01/05/2010 19:42:59] data/creaturescripts/scripts/tpondeath.lua:6: 'end' expected (to close 'function' at line 2) near 'else'

error in console
 
First off, tell me what distro you are using.
Second, install it correctly.
Thirdly Wibben stop giving him shitty codes.

You can't call an "else" unless theres a fucking "if" statement. Plus that script is redundant and useless. Sorry for being harsh but damn nukka you're making it worse.
 
I don't remember if statschange is in 0.3.6 I think it is. But I know preparedeath has a bug and won't work if you return it false.

[13/06/2010 11:19:50] [Warning - Event::loadScript] Event onStatsChange not found (data/creaturescripts/scripts/tpondeath.lua)

I guessing you installed wrong...
This should be how it is.
<event type="statschange" name="EVENTNAME" event="script" value="tpondeath.lua"/>

And then register it in login.lua of course.
 
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>
 
Last edited:
i will add it and i dont need to register it anywhere? like for example creature script i must register in creaturescript.xml
 
[13/06/2010 21:09:24] > Loading tpondeath.xml...
[13/06/2010 21:09:24] [Error - CreatureScript Interface]
[13/06/2010 21:09:24] buffer
[13/06/2010 21:09:24] Description:
[13/06/2010 21:09:24] [string "config = {..."]:3: '}' expected (to close '{' at line 1) near 'townid'

in console :p
 
my GOD ^^ love u :D

i got full hp after death and i havent this stupid window :D but i didnt get tp :D can u edit it for me??
________________________________
man but there is one little problem :/ when i kill player , he get full hp but i dont get frag :/ maybe u can add somewhere
doPlayerAddFrag?? :D
 
the config is easy to understand,

if you want them to be teleported to their home town then replace "false" with "true"
masterpos = true, -- set to true if you want them teleported to their home town

UNLESS you want it to be teleported to a certain town, then replace the townid "0" with the new town id
townid = 1, -- if masterpos is false then set for custom town or set to 0 for custom position

IF you don't want any of those, set a certain position, just change:
position = {x = 1231, y = 988, z = 8}
 
Back
Top