Screen GUI Not Functioning Properly

My frame and textbuttons appear properly on command but when they are meant to close, the textbuttons stay on the screen.

	local gui = script.Parent.Parent.Parent.ScreenGui
	local frame = script.Parent.Parent.Pages -- Replace "TESTFRAME" with your frame name.
	local textbutton = script.Parent.Parent["Dances Button"] -- Replace "OPENCLOSETESTFRAME" with your TextButton name.
	local open = script.Open
	local close  = script.Close
	open.Value = true

local PrevButton = script.Parent.Parent.PrevButton
local NextButton = script.Parent.Parent.NextButton

textbutton.MouseButton1Click:Connect(function()
	for _, buttons in pairs(gui:GetChildren()) do
		if buttons:IsA("TextButton") and buttons ~= textbutton then
			if open.Value == true then
				buttons.Visible = true
				frame.Visible = true
				open.Value = false
				close.Value = true
				textbutton.Text = "Close Dances" -- Change to what you want to say.
			elseif close.Value == true then
				buttons.Visible = true
				frame.Visible = false
				open.Value = true
				close.Value = false
				textbutton.Text = "Dances" -- Change to what you want to say.
			end
		end
	end
end)
1 Like

On the second debounce you forgot to set the buttons visibility to false. Hoped this help :+1:

It sort of helped. I am now left with this wierd outcome…

All i did was change the true to false.

1 Like

Can you send me a screenshot of your GUI, with everything opened. Possibly that button might not exist in the Buttons frame instance.

Here is my entire GUI explorer list:

mydancegui001

The button labeled “NextButton” is the > button, the odd one out, having the issue in the video.

1 Like

Maybe you should directly set the PreviousButton and NextButton’s visibility to false when the menu closes like this:

elseif close.Value == true then
				buttons.Visible = false
				frame.Visible = false

                NextButton.Visible = false
                PrevButton.Visible = false

				open.Value = true
				close.Value = false
				textbutton.Text = "Dances" -- Change to what you want to say.
			end

I also added this to the beginning set and it worked!!!

NextButton.Visible = true
PrevButton.Visible = ftrue

Thank you very much

1 Like

Your welcome! :+1: I hope you have a good rest of your day

1 Like