So I am trying to get better with tables and I looked at the ROBLOX wiki and found table.sort. This is my first attempt at using table.sort and I got this error. https://gyazo.com/b76fef1653f8dfaaef630f90740570fc This is the script that I am using,
t = game.ReplicatedStorage.Stuff:GetChildren() table.sort(t) print(table.concat(t, ' '))
Here is what the replicatedstorage looks like, https://gyazo.com/eeedaeb30805841f6a2bd2438516466a Can anyone help with this?
You're trying to sort objects with this - table.sort() only works with strings.
You'll have to convert it to strings, with something like the code below:
t = game.ReplicatedStorage.Stuff:GetChildren() local newTable = {} for i = 1, #t do table.insert(newTable, 1, t[i].Name) end table.sort(t) print(table.concat(t, ' '))