How would I sort a folder that consists of hats, hairs, etc. that has an IntValue to represent which order they should go in inside a table? I'm not sure if I asked this correctly, had to re-type this 4 times. Here's a picture example:
http://prntscr.com/jhgu62
Not sure how to go about this, my brain isn't working entirely well as of now. Could anyone lead me in the right direction?
You can use table.sort to do this, by passing in a comparator function:
-- First create a table of your objects local objects = workspace.Folder:GetChildren() -- Now use table.sort to get the order that you want table.sort(objects, function(obj1, obj2) return obj1.ID.Value < obj2.ID.Value end)
This code assumes your folder is called Folder, and is in the workspace, and the IntValue of each object is called ID. You will need to change this to match how you have things set up.