I have a table consisting of key/value pairs:
mytable[a] = 1,
mytable[b] = 4,
mytable[r] = 7,
mytable[f] = 2,
etc.
I want to sort the table by the numbers. So I'd like the table to be {(a, 1), (f, 2), (b, 4), (r, 7)} I've tried using
table.sort(mytable, function(a, b) return a[2] > b[2] end)
but that didn't seem to work... Thankyou