Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. local iConfig = nil
  2. local sName = "config"
  3.  
  4. local function save(sInput)
  5. local file = io.open(sName,"w")
  6. file:write(tostring(sInput))
  7. file:close()
  8. end
  9.  
  10.  
  11. save(100)
  12.  
  13. if fs.exists(sName) then
  14. print("Loading config")
  15. file = io.open(sName,"r")
  16. iConfig = tonumber(file:read())
  17. print(iConfig)
  18. file:close()
  19. print("Config loaded")
  20. else
  21. print("No config")
  22. iConfig = 0
  23. end
  24. print(iConfig)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement