Random player from team events?
So, I am trying to make a survival game. There are three teams, Red (eliminated) Orange (Alive) and Yellow (Eliminator). I am trying to make a script where one person from the alive team becomes an eliminator. I know how to make a random player chooser script, but I don't want anyone from the eliminated team to get chosen. I tried out a script but it doesn't work. Does anyone know whats wrong with this script? Thanks, taxicar24
1 | local ChosenPlayer = game.Teams [ "Neon orange" ] :GetPlayers() [ math.random( 1 ,#game.Teams [ "Neon orange" ] :GetPlayers()) ] |
2 | ChosenPlayer.TeamColor = BrickColor.new( "New Yeller" ) |