From GMod Wiki
AddCSLuaFile( String FileName )
Where is this used?
|Used to send lua files to client.|
|Part of Library:||Global Functions|
|BBCode Link:||[b][url=http://wiki.garrysmod.com/?title=G.AddCSLuaFile]G.AddCSLuaFile [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]|
|Description||Sending to the clients the files they need.|
AddCSLuaFile( "shared.lua" ) AddCSLuaFile( "cl_init.lua" )
- The lua cannot be added after everything has been initialized anymore because of the new datapack feature.
- All client Lua-files should be sent this way.
- The file name must not include ".." - this is the special folder name to go up a folder.
- The path is relative to the addon's lua folder.
- You still need to include the file clientside to use it. If you want to run it automatically, make sure that it's in the autorun directory.
- This function seems to not throw an error if it fails to find the file. The only error will be a failure to include the file on the client.