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