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!
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?
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.
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
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…
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