Auto updater Lua

How can i make a script auto update and replace on lua/autorun/client/test.lua ?
With http.Get > Runstring …

You can’t write .lua files.

Thanks for the reply.

Edit: But can i open a existing lua file and replace all the code with a news (http.Get) ?

No, you can’t write to any files other than those with .txt filetype

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]

Thanks.