You could try using a set of pairs, but these would not be indexed by key.
local _set = {
{"OB1", 8},
{"OB2", 1},
{"OB3", 10},
{"OB4", 6}
}
table.sort(_set,
function(a, b)
return a[2] > b[2] -- if pair a's 2nd value is greater than pair b's 2nd value, sort a above b
end
)
-- After sorting:
-- set[1] = {"OB3", 10}
-- set[2] = {"OB1", 8}
-- set[3] = {"OB4", 6}
-- set[4] = {"OB2", 1}