Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Place the MenuGui ScreenGui under StarterGui
- local Player = game.Players.LocalPlayer
- local SampleMenuFrame = script.Parent.SampleMenuFrame
- local MenuFramesFolder = script.Parent.MenuFrames
- local PageLayout = MenuFramesFolder.UIPageLayout
- SampleMenuFrame.Visible = false
- --Insert menu categories below using the format provided. Use commas after each item and category.
- local MenuCategories = {
- Drinks = {
- "Drink1",
- "Drink2",
- },
- Appetizers = {
- "Appetizer1",
- "Appetizer2",
- },
- Desserts = {
- "Dessert1",
- "Dessert2",
- }
- }
- --Insert the order of your menu categories below using the format provided. Use quotes around each category and insert commas after each.
- local MenuCategoriesOrder = {"Drinks", "Appetizers", "Desserts"}
- for MenuCategory, MenuItems in pairs(MenuCategories) do
- local MenuFrame = SampleMenuFrame:Clone()
- local MenuFrameTitleLabel = MenuFrame.TitleLabel
- local MenuItemsBox = MenuFrame.MenuItemsBox
- local NextButton = MenuFrame.NextButton
- local BackButton = MenuFrame.BackButton
- MenuFrame.Parent = MenuFramesFolder
- MenuFrame.Name = MenuCategory
- MenuFrame.LayoutOrder = table.find(MenuCategoriesOrder, MenuCategory)
- MenuFrame.Visible = true
- MenuFrameTitleLabel.Text = MenuCategory
- for Index, MenuItem in ipairs(MenuItems) do
- MenuItemsBox.Text = MenuItemsBox.Text .. MenuItem .. "\n"
- end
- NextButton.MouseButton1Click:Connect(function()
- PageLayout:Next()
- end)
- BackButton.MouseButton1Click:Connect(function()
- PageLayout:Previous()
- end)
- end
Add Comment
Please, Sign In to add comment