How To Save To A File Lua

[Solved] How To Save To A File Lua | Lua - Code Explorer | yomemimo.com
Question : how to save to a file lua

Answered by : adxm

function saveHighScore(score) print("High score: "..tostring(score)) local file,err = io.open("high_score.txt",'w') if file then file:write(tostring(score)) file:close() else print("error:", err) -- not so hard? end
end

Source : https://stackoverflow.com/questions/31044594/lua-saving-to-file | Last Update : Thu, 03 Dec 20

Answers related to how to save to a file lua

Code Explorer Popular Question For Lua