It's supposed to make the player change teams and hide a team selection GUI while doing so.
local player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Visible = false player.TeamColor = BrickColor.new("Br. yellowish orange") player:LoadCharacter() end)
It changes teams, but doesn't hide the GUI.
Did you verify that 'script.Parent.Parent' points to the GUI that you want to set invisible? One way you could check this is to give the GUI a name, add a debug print:
print(script.Parent.Parent)
And see that the name matches what is printed when the script runs.
On a side note, assuming you are running this as a LocalScript, see the notes for LoadCharacter:
I'm not sure that you can use LoadCharacter() in a local script