Heres another way using databases…
This is abit more complicated, but you can put alot of information into a database, therefore saving lots of different variables if you wanted. Below is a quick example of creating/updating/loading from a database.
--Need to require this somewhere to use Databases..
local sqlite3 = require("sqlite3")
local totalThrows = 0 --Variable that we are saving/loading to.
--Create the database to be used...
local function setupDatabase()
local dbPath = system.pathForFile("throwInfo.db3", system.DocumentsDirectory)
local db = sqlite3.open( dbPath )
local tablesetup = [[
CREATE TABLE throws (id INTEGER PRIMARY KEY, amount);
INSERT INTO throws VALUES (NULL, '0');
]]
db:exec( tablesetup )
db:close()
end
setupDatabase()
--Saves throws to a database that has already been created..
local function saveThrows()
local dbPath = system.pathForFile("throwInfo.db3", system.DocumentsDirectory )
local db = sqlite3.open( dbPathA )
local update = "UPDATE throws SET amount = '"..totalThrows.."'"
db:exec(update)
db:close()
end
saveThrows()
--Load throws from a database that has already been created..
local function loadValue()
local dbPath = system.pathForFile("throwInfo.db3", system.DocumentsDirectory)
local db = sqlite3.open( dbPath )
for row in db:nrows("SELECT \* FROM throws'") do
totalThrows = row.amount
end
db:close()
end
loadValue()
Also, bear in mind that i just typed this out in notepad and pasted it here, so it hasnt been tested, but i dont see why any of it wouldnt 
Hope some of this has helped. [import]uid: 69826 topic_id: 17824 reply_id: 68020[/import]