Advertisement
Guest User

Created by maurtis150 on Facepunch. Adapt to your needs

a guest
Nov 11th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. local files = {}
  2.  
  3. function autoReload(fileName)
  4.     files[fileName] = 0
  5. end
  6.  
  7. function checkAutoReload() 
  8.     for k, v in pairs(files) do
  9.         local t = file.Time(k, "LUA")
  10.  
  11.         if t then
  12.             if files[k] != t then
  13.                 files[k] = t
  14.  
  15.                 include(k)
  16.             end
  17.         else
  18.             print("invalid file: ", k)
  19.             files[k] = nil
  20.         end
  21.     end
  22. end
  23. timer.Create("checkAutoReload", 0.1, 0, checkAutoReload)
  24.  
  25. autoReload("simploo/simploo.lua")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement