Jump to content

Respawn after Dead


MasterTobi

Recommended Posts

Posted

Read the scripting intro first, it will surely come in handy.

Then, check out addEventHandler (and some basic info about the event system will also be useful) and the onPlayerWasted event.

Then, the spawnPlayer function.

Posted

thx

now i can respawn :)

the code for another people :

  
function respawn() 
  
setTimer( spawnPlayer,--Time, 1, source, --x, --y, --z ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), respawn ) 
  

Posted
thx

now i can respawn :)

the code for another people :

  
function respawn() 
  
setTimer( spawnPlayer,--Time, 1, source, --x, --y, --z ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), respawn ) 
  

code should be

function respawn(player, Time) 
local x,y,z = getElementPosition (player) 
setTimer( spawnPlayer,Time, 1, player, x, y, z ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), respawn ) 

-- will ignore the whole line, not just one word :)

Posted
thx

now i can respawn :)

the code for another people :

  
function respawn() 
  
setTimer( spawnPlayer,--Time, 1, source, --x, --y, --z ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), respawn ) 
  

code should be

function respawn(player, Time) 
local x,y,z = getElementPosition (player) 
setTimer( spawnPlayer,Time, 1, player, x, y, z ) 
end 
addEventHandler ( "onPlayerWasted", getRootElement(), respawn ) 

-- will ignore the whole line, not just one word :)

I believe he was aware of that, just using them as placemarkers rather than actual code

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...