Level selection GUI for my game

My game needs a level selection GUI. I feel stuck and I haven’t found any useful solutions. It would be nice if someone could tell me or link a video explaining how to create a level selection GUI. Any help would be great! Thanks!

1 Like

Could you explain?

Do you mean:
Say we have 10 obby stages,(“10 levels”).
So the players should be able to select which level they want to teleport to?

Do you want select level GUI to teleport for different level?

1 Like

I’ll try to make and send you a file of a demo but what you would want to do is clone a UI for every level. So what you do is create a template button then use for loop to clone the button for each level you have (and name it the stage number). After that you just make it so when you click that button, you go to the stage with the same number as the button.

RobloxScreenShot20220816_151228674

1 Like

maybe this can help you

local LevelButtons = game.Players.LocalPlayer.PlayerGui.ScreenGui.ScrollingFrame:GetChildren()

for _, Button in ipairs(LevelButtons) do -- Loop trough all buttons
	
	if not Button:IsA("TextButton") then continue end -- Make sure it ignores the UIGridLayout
	
	Button.MouseButton1Click:Connect(function()
		print("Start level: "..Button.Name)
	end)
	
end

let me know if you don’t understand it

1 Like

Here is the place file I worked a little on:
Baseplate.rbxl (43.8 KB)

So currently it only prints the level numbers and fires an event to the server where the script fires the level number they received.

However when I tested it, for some reason when the buttons were pressed, some of them printed the wrong numbers which I was too tired to fix so you can probably ask others for help but ya…

1 Like

Also all you really gotta do after fixing the buttons is write the teleport script inside Event.OnServerEvent and boom that should be it

If you have any questions just ask me or the forum

2 Likes