Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script that has a random player on a specific team?

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago
local randomPlayer = (game.Players:GetPlayers())[math.random(1,#(game.Players:GetPlayers()))]
randomPlayer.TeamColor = BrickColor.new("Really red")

Ad

Answer this question