Hi, I am storing my highscore in a .txt file, it works well but when I update the app the highscore returns to the value that was stored in the .txt file inside my computer when I created the .apk
There is a way to fix it? I am using this for storing the highscore:
READING:
local path = system.pathForFile("highscore.txt") local file = io.open(path, "r") local content = file:read("\*a") highscore = tonumber(content) io.close(file) file = nil
WRITING:
local path = system.pathForFile("highscore.txt") local file = io.open(path, "w") file:write(highscore) io.close(file) file = nil