I have tried using table.sort to sort my table of mixed bool values in order to have the true values first in line, and then the false values last in line in the table. As so:
a = true
b = false
c = true
vals = {a, b, c}
local sorted_vals = table.sort(vals, function(a, b) if a == true then return a elseif b == true then return b end end)
print(unpack)
--[[
the new order of the table should be:
a, c, b
--]]

1 comment
The problem I have is that this isimply does not work, and I cannot find any workaround. I have scarce knowledge of any sorting algorithms as well .