local player = game.Players.LocalPlayer player.Changed:Connect(function(changed) if changed == "TeamColor" then -- how do I check if it changed to red team Print("team Changed to red") end end)
Following your code you'd do it this way:
local player = game.Players.LocalPlayer player.Changed:Connect(function(changed) if changed == "TeamColor" then if player.TeamColor == BrickColor.new("Really red") then --replace with the BrickColor of the team print("team Changed to red") end end end)
However I'd recommend checking for the actual team instead of its color, and using GetPropertyChangedSignal
local team = game:GetService("Teams"):FindFirstChild("Team Name Here") player:GetPropertyChangedSignal("Team"):Connect(function() if player.Team == team then print("team changed to red") end end)