How do I select the most recent number from a folder?

local Folder = #script.Parent.Items:GetChildren()

How do I select the most recent item from a folder?

1 Like

I am happy to help, but what do you mean by "select the most recent number, what do you want the script to execute?

1 Like

Inside the folder I have things in numbers 1, 2, 3, 4, 5… and I need to take a lot of things inside and select the last thing under the last number

1 Like

You cant store numbers (you mean numberValues) in folders, that would be a table.

1 Like

There are things under the numbers. I specifically designate them with numbers, I need it.

1 Like
local FolderClone = table.clone(Folder)
table.sort(FolderClone,function(a,b)
     return tonumber(a) > return tonumber(b)
end)

print(FolderClone)

i think this is what ur looking for

1 Like

Is it possible to come up with something similar?

local HowManyInFolder = #dialogueFolder|
print(dialogueFolder:FindFirstChild(HowManyInFolder))|
1 Like

for _,v in ipairs() or for _,v in pairs()