LUACategory Archive

Problems with cl_init.lua

Friday, July 31st, 2009

I was writing a gamemode for Garry’s Mod and I came across a odd problem. Suddenly cl_init.lua was seemingly not being run on the client, even though it downloaded.

I spent hours doing a variety of things that were of no use. But the solution is simple. I thought that the client just wasn’t executing or running it.

When you use sv_downloadurl, for some reason it looks for the LUA cache files there and download the 404 error page, which obviously isn’t LUA.

However your don’t upload cl_init.lua

You upload your cache/dua folder and it works perfectly. You have to do this every time you change the gamemode or addons because this is the LUA cache so you should only really use it when you have gotten your gamemode/addons just the way you like it. Remember that you have to let the server start, then upload the cache because the cache is generated when the server starts.