I want to write to a value in my lua module, using the code below:
1 2 3 4 5 6 7 8 9 | local levelPacks = require "levelpacks" if levelPacks[locCurrentLevelPack][locCurrentLevel].score > levelPacks[locCurrentLevelPack][locCurrentLevel].hScore then levelPacks:write(levelPacks[locCurrentLevelPack][locCurrentLevel].hScore = levelPacks[locCurrentLevelPack][locCurrentLevel].score) end |
Do you just want to change the score within the app's runtime or are you attempting to save the score to a file ?
If it's saving, have you considered or tried JSON ?
Yeah I realise I can't edit the structure as its in a certain directory that doesn't allow me to do so, just converted my structure to JSON now to have another go.