G.AddCSLuaFile
From GMod Wiki
Function | |
Syntax |
AddCSLuaFile( String FileName ) Where is this used? |
Description: | |
Used to send lua files to client. | |
Returns: | nil |
Part of Library: | Global Functions |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.AddCSLuaFile]G.AddCSLuaFile [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Sending to the clients the files they need. |
---|---|
Used on | |
Code | AddCSLuaFile( "shared.lua" ) AddCSLuaFile( "cl_init.lua" ) |
Output | N/A |
Additional Notes
- 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.