The script I have here I am using to(at random) select someone to be on the orange team. The problem is that when there are two(or more) people on the game it runs it for the amount of players on the game.
players = game.Players:GetPlayers() for i,v in pairs(game.Players:GetPlayers()) do if #players >= 1 then first_infected = players[math.random(1, #players)] first_infected.TeamColor = BrickColor.new("Bright orange")--This is all in a function so it will run.
So my question is: How can I make it so it only changes the team of one person at one time? Hope this make sense
Thanks
Simply remove your loop. There isn't a reason for there to be a loop here; no operation is "per player", there is just a single thing happening that happens to use a list of players.