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)
Check if you have ResetOnSpawn
still enabled in the properties for the ScreenGUI.
Example: https://imgur.com/a/9Y2zv79
I had this problem when I started too. Hope it solves the problem!