I have a folder with 12 integer values in it. As a round goes on the values of said integer values will change. I want to find a way to sort them from greatest to least.
Any help will be appreciated!
local IntFolder = script.Parent.ValueFolder -- Enter the path of your folder local Highest = 0 local HighestObject for _, v in pairs(IntFolder:GetChildren()) do if v:IsA("IntValue") then if v.Value > Highest then Highest = v.Value HighestObject = v end end end print(HighestObject:GetFullName())
This goes through the objects in your folder, checks if they are integer values, checks if their value is higher than the highest value, sets the highest value to their value and sets the highest object to the value.