local t = {{15,6},{11,8},{13,10}}
I need to show the table in order on the second number
exemple:
1 -> {13,10} -- why 10 > 8
2 -> {11,8} -- why 8 > 6
3 -> {15,6}
table.sort takes a function that is used to compare the two (it uses < if one isn't provided). So simply pass a function that will be called to do the comparison on the elements.
local t = {{15,6},{11,8},{13,10}}
table.sort(t, function(lhs, rhs) return lhs[2] < rhs[2] end)
table.sortin the Lua documentation.