Jump to content

command /spec


eSports

Recommended Posts

Hi

I want to script to change the team, provided that does not have the health less than 50

tests

function dramex() 
if (getElementHealth(getLocalPlayer()) == -30) then 
outputChatBox ( " Erorr " ) 
else  
local team =getTeamFromName("Spectator") 
setPlayerTeam(player, team) 
end 
end 
addCommandHandler ( "spec", dramex) 
  

Link to comment

"if" is wrong.

"getLocalPlayer" is only for client-side

  
function dramex(player, command) 
if (getElementHealth(player) >= 50) then 
outputChatBox ( " Erorr " ) 
else 
local team =getTeamFromName("Spectator") 
setPlayerTeam(player, team) 
end 
end 
addCommandHandler ( "spec", dramex) 
  

Link to comment
"if" is wrong.

"getLocalPlayer" is only for client-side

  
function dramex(player, command) 
if (getElementHealth(player) >= 50) then 
outputChatBox ( " Erorr " ) 
else 
local team =getTeamFromName("Spectator") 
setPlayerTeam(player, team) 
end 
end 
addCommandHandler ( "spec", dramex) 
  

thanksssssssss

<3

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