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)