Hello. I’ve encountered a simple issue: I would like to change the index order of an instance inside a folder.
In our example, here is our folder:
However, if we run this command:
Our input will be this:
I would need to change the index since it shows these choices in a ‘random’ order (Choice 3 → Choice1 → Choice 3)
(Read the code, you will understand what I mean:)
for i = 1,#ChoicesFolder do
TS:Create(ChoicesFolder[i],TweenInfo.new(.5),{TextTransparency = 0}):Play()
wait(.3)
end
local ChoicesFolder = workspace.ChoicesFolder
local TS = game:GetService("TweenService")
local choices = ChoicesFolder:GetChildren()
for i = #choices, 2, -1 do
local j = math.random(i)
choices[i], choices[j] = choices[j], choices[i]
end
for i = 1, #choices do
TS:Create(choices[i], TweenInfo.new(.5), {TextTransparency = 0}):Play()
wait(.3)
end