Jump to content

[HELP] I can't respawn my Player


Recommended Posts

function respawn() 
            for k, v in ipairs(getElementsByType("player") do 
                  local team = getPlayerTeam(v) 
                  local health = getElementHealth(v) 
                     if team then 
                         if (getTeamName(team) == "Assasin" ) and health < 0 then 
                              spawnPlayer(source, 0, 0, 5, 0, math.random(0, 288), 0, 0) 
                              setPlayerTeam(source, team) 
                              giveWeapon(source, 8, 1) 
                              giveWeapon(source, 1, 1) 
                        elseif (getTeamName(team) == "Gunner") then 
                                   spawnPlayer(source, 0, 0, 5, 0 , math.random(0, 288), 0, 0) 
                                   setPlayerTeam(source, team) 
                       end 
                  end 
              end 
end 
addEventHandler("onResourceStart", root, respawn) 

Link to comment

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