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()

2 comments
What does "HIT" refer to?
Not entirely sure, it was from this post that had to do with this: https://scriptinghelpers.org/questions/3429/how-do-i-make-it-so-that-a-script-will-only-activate-if-a-certain-team-touches-it