I'm having quite a bit of trouble creating a custom function for table.sort that I need to use since I'm sorting values that have both numbers and letters.
Here's what I have so far:
table.sort(backpackitems, function(a, b)
local aNum = tonumber(string.sub(a.Name, 8))
local bNum = tonumber(string.sub(b.Name, 8))
end)
After I get the number values from the strings, how do I put one table item in front of the other if its number is the larger of the two?
