I have a table of date that is to be returned from a server script via invokeserver.
The table is built from a selection of tables in the server script.
The table is defined with
loacl table = {}
The code in a loop to set one entry in the table is
table[string1] = {string1, int1, int2}
The client needs the table be sorted in order.
I have tried table.sort(tablename,function(a,b) return a<b end) but when I print out the table it is not sorted.
Can someone please suggest how I can get this table sorted.
I need to be able to access the data by using a value for the index and then get the values for the ints.
For example say the index is “Dirt” then I would get the values by using table[“Dirt”][2] for the first int and
table[“Dirt”][3] for the second one.