What do you want to achieve?
Table to sort by the price.
What is the issue?
Table sorting is not working, and i cant see what the problem is even though its super simple.
What solutions have you tried so far?
Looked at multiple posts on this issue, couldnt understand why mine didnt work.
local toolProperties = {tool.Name, tool.Price.Value}
table.insert(tools, toolProperties)
table.sort(tools , function(a , b)
return a[2] > b[2]
end)
for _,v in pairs(tools) do
print(v[1], v[2])
end
This is cut out from my local script, everything seen here is labelled right.
I know theres alot of posts about it but i just cant figure out what the problem is. (Im am new to tables)
you have to make another table, where the indexed price would be a tool price value, then you doing for loop and simply sorting value from smallest to biggest