How to make buttons with modules

How do I make a menu system where I click on the menu buttons, the button change texts?

For example:
(Before clicking any)

  1. Play
  2. Settings
  3. Menu

(After clicking Settings)

  1. Graphics
  2. Volumes
  3. Lighting

And all the text in the text button are from a module. This is to ensure that I can edit what is written on it.

Also, adding more strings in the module will create more buttons.

1 Like

Hi.

This is how I would do it personally,
Menu ModuleScript

return {
	["Play"] = {},
	["Settings"] = {
		["Graphics"] = {
			["Shadows"] = {"Off", "Low", "Medium", "High"},
		},
		["Volumes"] = {

		},
		["Lighting"] = {

		}
	},
	["Menu"] = {

	},
}

^ and then with that you can have like

["Shadows"] = {UI = game.Players.LocalPlayer.PlayerGui.Menu.Settings.Graphics, Options = {"Off", "Low", "Medium", "High"}},
3 Likes

But how do I make it work? I am confused on how the text button change.
Also, how will the script know what to do when we click one of the buttons?

From the example given above, if you are going to work with dynamic UI, you will normally index your properties, like 1,2,3,4… each value has a text in a table.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.