Hello guys, I’m using the LOADSAVE module to create and handle JSON tables for my game.
I have follow the topic that can be found @ https://forums.coronalabs.com/topic/34348-table-saving-problem/
in order to save the table only the first time the app is launched, and everything is working fine.
The problem arrives when I try to use it, for instance, the code below:
local myTable = loadsave.loadTable("myTable.json", system.DocumentsDirectory) if myTable==nil then local tV = {} tV.dubaiHasBeenPurchased = true tV.romaHasBeenPurchased = true tV.alaskaHasBeenPurchased = true tV.newYorkHasBeenPurchased = false tV.lasVegasHasBeenPurchased = false loadsave.saveTable(tV, "myTable.json", system.DocumentsDirectory) end if(tV.newYorkHasBeenPurchased==false)then envSetChoosed0 = 1 envSetChoosed1 = 2 envSetChoosed2 = 3 end if(tV.newYorkHasBeenPurchased==true and tV.lasVegasHasBeenPurchased==false)then envSetChoosed0 = 1 envSetChoosed1 = 2 envSetChoosed2 = 3 envSetChoosed3 = 4 end
returns “Attempt to index global ‘tV’ (a nil value)” on
if(tV.newYorkHasBeenPurchased==false)then
What am I doing wrong?
Thank you.
