Help on Gui not showing back up, Help please

  1. So I am trying to get my gui button to disappear when your in the main menu and reappear when you leave it. but I am not using any Visible scripts just destroy and camera scripts

  2. When I press the play button, the gui doesn’t reappear

  3. I’ve did a play button1down script.

local mainmenu = script.Parent.Parent:WaitForChild("MainMenu")
local PlayButton = mainmenu:WaitForChild("PlayButton")
local RebirthButton = script.Parent.RebirthButton
local MenuOpen = true


if MenuOpen == true then
	RebirthButton.Visible = false
	MenuOpen = false
end
if MenuOpen == false then
	RebirthButton.Visible = true
end

edit: Changed code

You need to use .Changed events.

MenuOpen.Changed:Connect(function()

Hey, now when I load in its automatically open

Try this

 If MenuOpen == true then
       RebirthButton.Visible = not RebirthButton.Visible 
       MenuOpen = false
else
        RebirthButton.Visible = not RebirthButton.Visible 
         
end

Hi there! In this case, you’ll have to use MouseButton1Click. Here’s how to fix your script:

local mainmenu = script.Parent.Parent:WaitForChild("MainMenu")
local PlayButton = mainmenu:WaitForChild("PlayButton")
local RebirthButton = script.Parent.RebirthButton
local MenuOpen = true

PlayButton.MouseButton1Click:Connect(function()
	if MenuOpen == true then
		MenuOpen = false
		RebirthButton.Visible = false
	elseif MenuOpen == false then
		RebirthButton.Visible = true
		MenuOpen = true
	end
end)