Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Next Button In My GUI Doesn't Work and It Doesn't Give any Errors?

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)

2 comments

1

Try prining something in the function.

0

I already tried it and printing works in the function.

2 answers

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.