I’m trying to make a character creation menu and I’m trying to make it so you click through some arrows and each time you click an arrow the corresponding UI will come up on the screen (as well as change the name of the text label, which I’ll show below)
I’m not quite sure what to do next to achieve what I’m trying to do. Any help is appreciated, if I didn’t explain something clearly enough let me know and I’ll go into further detail… Like I said any help is appreciated
The folders labeled Shirts, Pants, etc are just organizational folders and house the UI for those specific things. The LocalScript under the “Forwards” TextButton is the script that is in the post.
What you’d do is Main[SelectionArray[SelectionIndex]] to index to the correct folder. Under that folder you’d want indentical named elements so you can toggle their visibility
I’m not quite sure what you mean (im new to scripting, arrays are VERY VERY new to me)
Also, what about changing the text label (SelectionGroupUI TextLabel) to tell the user which ‘tab’ there on? Would I just keep doing what I’m doing and set the text in the text label to the index in the SelectionArray? (example: TextLabel.text = SelectionArray[2])
I have one more question, though:
Since there is other UI assosciated with this, how would I go about making that UI visible each time the arrow is pressed?
local Players = game:GetService("Players")
local SelectionArray = {"Hair", "Skin", "Beard", "Face", "Shirts", "Pants"}
local SelectionIndex = 1
local mainUI = Players.LocalPlayer.PlayerGui.ScreenGui.CharacterCreationUI.Main
local selectionUI = mainUI.Selection
local uiPath
script.Parent.Activated:Connect(function()
if SelectionIndex < #SelectionArray then
SelectionIndex += 1
selectionUI.Backwards.Visible = true
else
SelectionIndex = 1
selectionUI.Backwards.Visible = false
end
if uiPath then
uiPath.Visible = false
end
uiPath = mainUI:FindFirstChild(SelectionArray[SelectionIndex]):FindFirstChild("name of ui inside folder")
if not uiPath then
warn("UI not found")
return
end
uiPath.Visible = true
selectionUI.SelectionGroupUI.Text = SelectionArray[SelectionIndex]
end)