I've made pages in my GUI but my next page button isn't working. I tried a lot of thing but none of them worked. Please help.
Click this if you would like to see the GUI.
This is the highlighted script in the next button:
local Frame = script.Parent.Parent.Parent:WaitForChild('MainFrame') local Page1 = Frame.Page1 local Page2 = Frame.Page2 local Page3 = Frame.Page3 script.Parent.MouseButton1Click:connect(function() Page1.Visible = false wait(0.1) Page2.Visible = true end)
Not sure why your script doesn't work. Here's what I tried though
local Frame = script.Parent.Parent -- Accessing MainFrame local Page1 = Frame:WaitForChild("Page1") local Page2 = Frame:WaitForChild("Page2") local Page3 = Frame:WaitForChild("Page3") -- Unecessary if not being used script.Parent.MouseButton1Click:connect(function() Page1.Visible = false wait(0.1) -- Remove as it's not necessary (unless you really want that delay to happen) Page2.Visible = true end)
I fixed the problem by adding an If Statement
local Frame = script.Parent.Parent.Parent:WaitForChild('MainFrame') local Page1 = Frame.Page1 local Page2 = Frame.Page2 local Page3 = Frame.Page3 script.Parent.MouseButton1Click:connect(function() if Page1.Visible == true then Page1.Visible = false wait(0.1) Page2.Visible = true else print("Problem") end end)