local player = game.Players.LocalPlayer
function onAdded()
if player.TeamColor == BrickColor.new("Really red") then
print("yay, "..player.Name" got his defender panel")
else
script.Parent:Remove()
end
end
game.Players.PlayerAdded:connect(onAdded)
its in a localscript, I tried it in a normal script and it didn't work either. it still gives it to unauthorized teams and doesn't remove it when its supposed to on unauthorized teams

3 comments
your adding the gui before the teamcolor even changes, if this is a localscript player is already added
Try adding a wait(3) or longer at the start of your script and make Remove() into remove(). How are players becoming the team? ROBLOX places players in a team by amount that are in one already to even it out 1 by 1. Unless there is another script changing teams
its admin..