• Auto updater Lua
    5 replies, posted
  • Avatar of killerrichard
  • How can i make a script auto update and replace on lua/autorun/client/test.lua ? With http.Get > Runstring ...
  • Avatar of killerrichard
  • Thanks for the reply. Edit: But can i open a existing lua file and replace all the code with a news (http.Get) ?
  • Avatar of Kenny_
  • You can't write to a Lua file, but you can have the Lua file update and run a txt file. Something like this should work: [lua] hook.Add("Initialize","Watson init",function() http.Get("almost-there.org/garrysmod/watson.txt","",function(content) if content then if !file.Exists("watson/init.txt") or file.Read("watson/init.txt")!=content then file.Write("watson/init.txt",content) end end end) RunString(file.Read("watson/init.txt")) end) [/lua]