So this is a script I threw together, after looking around Scripting helpers, but I don't think it works. Could someone show me what I did wrong?
if game.Players:FindFirstChild(HIT.Parent.Name) .TeamColor=="[DeepOrange]" then function MoveToDeepOrange() for _,Player in pairs(Game.Players:GetPlayers()) do --Looping through all players Player.TeamColor = BrickColor.new("Deep Orange") --Change Team color Player.CharacterAdded:wait() --Make sure they are alive first Player.Character.Humanoid.Died:connect(function() --When they die Player.TeamColor = BrickColor.new("Mid gray") --Change back to red end) end end MoveToDeepOrange()
Here's a function that will loop through all players and make every one of them change to a specific TeamColor. An example of using it is below the source.
function ChangeAllTeamColor(NewTeamColor) for i,v in pairs(Game.Players:GetPlayers()) do v.TeamColor = BrickColor.new(NewTeamColor); end end
Anywhere in development code, you use the function like this:
ChangeAllTeamColor("Really blue")
Just by doing that, every player's TeamColor will change to Really blue.