Here's what I tried before my ROBLOX Studio crashed, took a screenshot so sorry for the white overlay.
Screenshot: http://prntscr.com/kgt31n
I've never used table.sort, table.concat, or tried to order a table from greatest to least. Let alone an entire UI. The names of the frames inside the "List" are numbers converted to int values as seen in the script. I've reread over the wiki's description over these and still couldn't grasp it. Could someone help me out? Really struggling with this q.q
There's a ROBLOX Gui element that is absolutely perfect for this, the UIListLayout. Insert a UIListLayout
in the frame, and set the sort order to LayoutOrder
. Then, on every object, set the LayoutOrder
property to the position you wish it to take. To accomplish a greatest to least value sort, make it LargestNumber - CurrentNumber
. This means that you find the largest value, and this value becomes LargestNumber
, and then for each element, Element.LayoutOrder = LargestNumber - ThisElementValue
.
Setting it to LayoutOrder will allow you to retain semantic names, although it does have a Name
sort option if you wish to use that as well, and then you just set the names to the order.