hello @Snow-Man welcome to the forum, I have prepared a code for your problem and tested it, you can solve your own problem by looking at my codes, I could not understand the code you prepared
local tkill = {{"aa", 10}, {"bb", 2}, {"cc", 5}}
addCommandHandler("adds", function()
local test = {"bla", 404}
table.insert(tkill, test)
end)
addCommandHandler("incr", function()
tkill[2][2] = 405
end)
addCommandHandler("show", function()
table.sort(tkill, function (a, b) return a[2] > b[2] end)
for i,_ in ipairs(tkill) do
outputDebugString(tkill[i][1].." "..tkill[i][2])
end
end)
this way you can constantly update, and do a short solution tests
local listUpdater = setTimer(function()
table.sort(tkill, function (a, b) return a[2] > b[2] end)
end, 300, 0)