Jump to content

Respawn,checkpoint


Charly2272

Recommended Posts

Posted

addEventHandler( "onPlayerWasted", root,
    function()
        if ( isElement(source) and getElementType (source) == "player" ) then
            local x,y,z = getElementPosition(source)
        setTimer( spawnPlayer, 3500, 1, source, x, y, z )
        end
    end
)

Hello friends, I want to create a car to appear at an exact point...
Example: if the player is in pvp and dies, he can appear in the same place where he died...
and I want to add a command to it...

excuse my bad english
Posted

Will the player appear in the same place where he died? or will the vehicle appear in the place where the player will spawn?

or will the car spawn where the player died?

Posted

addEventHandler( "onPlayerWasted", root,
    function()
       spawnpoints[source] = {getElementPosition(source)}
    end
)
  
addCommanHandler("respawn", 
    function(player)
       if isDead(player) then return end 
       if spawnpoints[player] then 
          setElementPosition(player, unpack(spawnpoints[player]))          
       end 
    end 
 )

 

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...