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

How do I make a "Change all players team" script??

local plrs = game.Players:GetPlayers()

plrs.TeamColor = BrickColor.new("Medium red")

1 answer

✓ Accepted answer

plrs points to a table.

The plrs variable points to a table. All you are doing is adding a TeamColor field into the table.

What you want to do is traverse the table, so you can get a reference to a player one at a time, via a generic for loop.

for _, player in ipairs(players) do -- pls change plrs to players in your script it's more readable
	player.TeamColor = BrickColor.new("Medium red")
end

I hope I helped, and if I did, don't forget to hit that "Accept Answer" button below. This will really help me and you out.

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