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)
✓ ANSWER ACCEPTED
How do I check If changed is changed to red team?
1 answer
✓ Accepted answer
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Please put all your code inside of code blocks
I did ut I dont know how to check if it changed to red team
if (player.TeamColor = BrickColor.new("Really red")) then ... end