Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local iConfig = nil
- local sName = "config"
- local function save(sInput)
- local file = io.open(sName,"w")
- file:write(tostring(sInput))
- file:close()
- end
- save(100)
- if fs.exists(sName) then
- print("Loading config")
- file = io.open(sName,"r")
- iConfig = tonumber(file:read())
- print(iConfig)
- file:close()
- print("Config loaded")
- else
- print("No config")
- iConfig = 0
- end
- print(iConfig)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement