Need help with understanding a choice menu!

While coming across the creation of a “Circle Choice Table” I noticed that there is indeed a more effective way of doing so via string patterns, (Format maybe[?])

(I already have the necessary underlying components of this such as Remote events, click events, Remote functions etc)

What I am trying to do is:

When the player clicks on a left arrow button, a ChoiceIndex variable goes down by a ChoiceCurrent (In this case, -1 because we’re going backwards on the menu).

It works as usual when the ChoiceCurrent variable is any number above 0.

My question is, what would I have to do with strings in order to achieve the goal of this visualization?
There are only 4 choices on my screen, but if you click further left while on Choice 1, how would I make it revert to the maximum choice? (In this case 4?)

And the other way around?

I think I can help you. Can you explain more?

1 Like

Here’s what I came up with so far, with some edits it could work

one for operators

local selected = script.Parent.selected

local array = {
	1;
	2;
	3;
	}



for _,operator in ipairs(script.Parent.operatorcontainer:GetChildren()) do

	if operator.Name=="forward" then
              operator.MouseButton1Click:Connect(function()
	selected.Value = selected.Value + 1
    for _,val in pairs(array) do
	if table.find(array,selected.Value) then
		operator.BackgroundColor3=Color3.new(12,123,31)--indicating it is selected
	end

for numbers

local buttoncontainer = script.Parent.Frame



for _,button in ipairs(buttoncontainer:GetChildren()) do
	
	button.MouseButton1Click:Connect(function()
		
		print("You have selected" .. button.Name)
        button.BackgroundColor3=Color3.new(82,255,151)
	
	 end)
	end

*colors to indicate selection , apart from print, which works

1 Like

I think you’re overcomplicating this.

if ChoiceIndex <= 0 then
ChoiceIndex = 4
elseif ChoiseIndex >= 5 then
ChoiceIndex = 1
end

Is there something I’m missing?

3 Likes

Yes, Sadly I must admit I did overthink this entirely. D: I just logged back on right now and tried this before being able to look at it. My deepest apologies to all. D:

2 Likes