Gtagasje Posted June 2, 2013 Share Posted June 2, 2013 Hello there, I have made a script that makes the players in the staff team invincible, atleast that's what I wanted to make, but whenever ANY player is in the staff team, all of the players in the other teams are also invincible. I don't know why, and I have tried a lot of things. This is my script: function StopDamage (theTeam) local players = getPlayersInTeam(getTeamFromName("Staff")) for i,v in pairs(players) do if getPlayerTeam(v) == getTeamFromName("Staff") then cancelEvent() end end end addEventHandler("onClientPlayerDamage", localPlayer, StopDamage) I think it should do what I want, but it turns out it doesn't. Thanks in advance, ~Gtagasje Link to comment
manawydan Posted June 2, 2013 Share Posted June 2, 2013 try function StopDamage () if getPlayerTeam(source) == getTeamFromName("Staff") then cancelEvent() end end addEventHandler("onClientPlayerDamage", localPlayer, StopDamage) 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