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.

3 comments
Indeed it does. An interesting thing to note is that the visibility portion will work fine by itself but doesn't work when included with the team changing part.
Actually, after testing this, if this GUI is by default visible, then respawning will clone a new GUI
Unselecting "ResetPlayerGuiOnSpawn" in the StarterGui properties worked. Thanks. <3