Why Does my GUI keep on becoming Visible after respawning?
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)
01 | local player = script.Parent.Parent.Parent.Parent.Parent |
04 | script.Parent.MouseButton 1 Click:connect( function () |
06 | player.Team = game.Teams.CounterTerrorist |
08 | script.Parent.Parent.Visible = false |
10 | script.Parent.Parent.Parent.BottomFrame.Visible = false |
12 | script.Parent.Parent.Parent.TextLabel.Visible = false |