This is the error I get:
Code: Select all
saving.lua:6: Syntax error: save.lua:1: '<name>' expected near '0'
Code: Select all
highscore: 0
Code: Select all
function save()
saveisthere = love.filesystem.exists("save.lua")
if not saveisthere then
savefile = love.filesystem.newFile("save.lua")
love.filesystem.newFile("save.lua")
print("File Creation Successful!")
highscore = 0
print("Data Cleared.")
savefile:open("w")
savefile:write("highscore: " ..highscore)
savefile:close()
print("New Data Saved.")
end
if saving then
savefile = love.filesystem.newFile("save.lua")
savefile:open("w")
savefile:write("highscore: " ..highscore)
savefile:close()
print("New Data Saved.")
end
end
Code: Select all
function load()
saveisthere = love.filesystem.exists("save.lua")
if saveisthere then
love.filesystem.load("save.lua")()
end
if not saveisthere then
print("No Save File Detected.")
end
end