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
local ChosenPlayer = game.Teams["Neon orange"]:GetPlayers()[math.random(1,#game.Teams["Neon orange"]:GetPlayers())] ChosenPlayer.TeamColor = BrickColor.new("New Yeller")
Can't test it right now, but I believe the following code works. Let me know if it doesn't.
local players = game.Teams["Neon orange"]:GetPlayers() local ChosenPlayer = players[math.random(#players)] ChosenPlayer.TeamColor = BrickColor.new("New Yeller")