Hi, I am using the code from here to save and load a table of information in my game. If I save a table with information in keys 1-10, then everything works as expected. If I save a value in the 11th key and above, the data does not save. Here is a simplified version of my problem:
local loadsave=require("loadsave") local table1 = {} table1[10]=12 loadsave.saveTable(table1, "myTable.json") table1 = loadsave.loadTable("myTable.json") print(table1[10]) --prints "12"
This works as expected and prints 12. On the other hand this does not work:
local loadsave=require("loadsave") local table1 = {} table1[11]=12 loadsave.saveTable(table1, "myTable.json") table1 = loadsave.loadTable("myTable.json") print(table1[11]) -- prints nil
This prints nil. Could someone explain why I can’t save something in the 11th key alone, or give me an alternative that will allow me to save information like this? Thanks!