Help with a arrow button page based GUI system

I am trying to make a page based GUI that will change the icons on the screen based on the page.

The issue is that in result, the top arrow button makes all of the GUI disappear while the bottom arrow button doesn’t change any GUIs whatsoever while the page prints themselves act up entirely I’m genuinely not quite sure what’s up with this.

Quickly editing to add a little bit more information, it seems to change the pages but the frames for each page never actually appear, causing a weird state where it just gives prints about which page is on but with no images. The images don’t come back either.

page list

I’ve asked a few people and haven’t gotten any solutions. Any help would be appreciated! Please ask if I need to make anything more clear.

local currentPage = 1
local pageList = workspace.GameComponents.GalleryMonitor1.Screen.Icons
local clickDetectors = workspace.GameComponents.ControlPadGallery

function changePage(hello)
	currentPage += hello
	
	if (currentPage >= 4) then
		currentPage = 1
	end
	if (currentPage < 0) then
		currentPage = 4 - 1
	end
	
	for i, v in pairs (pageList:GetChildren()) do
		if v.Name == "Page"..currentPage then
			print("v is "..v.Name.." and currentPage is "..currentPage)
			if v.Name == currentPage then
				print("setting "..currentPage.." to visible")
				v.Frame.Visible = true
			else
				print("setting "..currentPage.." to not visible")
				v.Frame.Visible = false
			end
		end
	end
end

clickDetectors.TopArrow.ClickDetector.MouseClick:Connect(function()
	changePage(-1)
	print("Current page is: ".. currentPage)
end)

clickDetectors.BottomArrow.ClickDetector.MouseClick:Connect(function()
	changePage(1)
	print("Current page is: ".. currentPage)
end)

https://developer.roblox.com/en-us/api-reference/class/UIPageLayout

1 Like

This actually seems to be what I need, didn’t know about this, thank you!