So I'm very new to coding and I'm trying to make a game with some friends. I made a script so that when you click on an ImageButton it switches your team, and the GUI Visibility is set to false. It works, however when you reset or respawn ingame, the GUI becomes visible again, why is this?
Note :The GUI is set to visible = true in the beginning (as if it were the main menu)
local player = script.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function()
player.Team = game.Teams.CounterTerrorist
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.BottomFrame.Visible = false
script.Parent.Parent.Parent.TextLabel.Visible = false
end)

1 comment
Press disabled on the GUI, then it will only appear for the desired people.