eSports Posted September 30, 2011 Share Posted September 30, 2011 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
Cadu12 Posted September 30, 2011 Share Posted September 30, 2011 "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
eSports Posted October 1, 2011 Author Share Posted October 1, 2011 "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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now