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

I can't seem to make all the player's teams to change, help?

Asked by 8 years ago

i tried to make all the player's team change after 15 seconds but it keeps giving me errors and i dont know how to fix it :( my code:

wait(15)
game.Players.TeamColor = TeamColor.new("Medium stone grey")

1 answer

Log in to vote
0
Answered by 8 years ago

I believe you have to set the team for each player individually. Try using

for key, object in ipairs(game.Players:GetPlayers()) do
    object.TeamColor = TeamColor.new("Medium stone grey")
end

However, this will still throw an error because TeamColor is set using BrickColor

So the proper code would be something like this

for key, object in ipairs(game.Players:GetPlayers()) do
    object.TeamColor = BrickColor.new("Medium stone grey")
end
0
I'm just throwing out there that I never could set a players team by the TeamColor, only by setting the actual team. FrostTaco 90 — 8y
Ad

Answer this question