I have a Lua table in the following form:
tTest = {}
tTest.word1 = {
IsOnline = true,
UpdateTime = 2,
Value = 150
}
tTest.word2 = {
IsOnline = true,
UpdateTime = 1,
Value = 25
}
tTest.word3 = {
IsOnline = true,
UpdateTime = 1,
Value = 1000
}
I want to iterate through this table with the highest Value first. So I tried this
for k,v in pairs(tTest, function(a,b) return a.Value > b.Value end) do
print (v.Value)
end
But it's not displaying the Values sorted.
Any help would be appreciated, thanks.