I am new to coding and have been looking for a tutorial for this online forever. I've decided to ask it here. So, I have a folder with 12 integer values, and I want to find out how I can list them from biggest to smallest using a table?
✓ ANSWER ACCEPTED
How to list integer values form least to greatest?
1 answer
✓ Accepted answer
Do this
local values = folder where you store your IntValues
local sortedValues = {}
for _, v in pairs(values:GetChildren()) do
table.insert(sortedValues, v.Value)
end
table.sort(sortedValues)
for number in ipairs(sortedValues) do
print(number)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
You're a legend! I'll chuck this code into my game and see if it works.
Remember to change the values variable to the folder where you store your IntValues. Have fun!
Hey, I have a question: How do you change another folder with 12 different integer values to the table's contents depending on value?
Just do game.ReplicatedStorage.Name of folder.
Like, I want to loop through the table and change values in a DIFFERENT FOLDER than the one used in the script. Also, is this for a server script or a local script?
Nevermind, I got it to work! Thanks for your help!