Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script that has a random player on a specific team?

I have a code that specifies the team color, but I don't know if I need to do more to make sure it switches to the correct team. Code:

local randomPlayer = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
randomPlayer.TeamColor = BrickColor.new("Really red")

1 answer

local randomPlayer = (game.Players:GetPlayers())[math.random(1,#(game.Players:GetPlayers()))]
randomPlayer.TeamColor = BrickColor.new("Really red")

This discussion is preserved as it was. New answers, comments, and votes are closed.