Reloading autorun with console

I’m testing a little clientside script in the autorun folder, but I’m getting tired of restarting the game to run it. Is there a console command that reloads your autorun folder?


Give me a seccond

for _, v in pairs(file.Find("…/lua/autorun/*")) do
if string.GetExtensionFromFilename( v ) == “lua” then
include(“autorun/” … v)

I doesn’t really reload it but ill think it will do fine most of the time

Whatever use seth his code

[lua]concommand.Add(‘reload_autorun’, function()
for k, v in pairs(file.FindInLua(‘autorun/*.lua’)) do

or you could just do

lua_openscript autorun/myscript.lua for server
lua_openscript_cl autorun/myscript_cl.lua for client

if you just need to reload one file

You can run individual files in your autorun folder with the command “lua_openscript_cl”

lua_openscript_cl autorun/client/test.lua

IF you have multiple files that needed reloaded you can use the things posted above.

[editline]19th January 2011[/editline]

Fucking ninjas, they’re everywhere. :tinfoil: