Lua Folder Structure
The structure of the Lua folder can be confusing. This page tries to layout where script files should go. If a folder is not mentioned here, you should not put your scripts into it unless you know what you are doing.
lua/
(Same as addons/<addonName>/lua/
)
autorun/
- A folder for automatic scripts load and include on Lua start, both clientside and serverside.
client/
- Clientside only autorun scripts.
server/
- Serverside only scripts.
properties/
- A Folder for properties in The Context Menu.
bin/
- A folder for external binary modules. (Creating Binary Modules)
derma/
- A folder for derma utils.
drive/
- A folder for drive system classes.
effects/
- Scripts placed here will be automatically attempted to be loaded as Lua effects. (util.Effect)
entities/
- Scripts placed here will be automatically attempted to be loaded as SENTs. (Structures/ENT)
includes/
- A folder for Lua libraries and additional stuff used in other scripts. Runs first.
extensions/
- A folder for extended libraries. For example table library already exists butextensions/table.lua
extends it.
modules/
- A folder for libraries.
matproxy/
- A folder matproxy stuff.
menu/
- A folder used for Menu state.
postprocess/
- Run by client on startup, typically contains Sandbox Post Processing effects.
skins/
- A folder for users derma skins.
vgui/
- Clientside folder for UI panels.
weapons/
- Scripts placed here will be automatically attempted to be loaded as weapons. (Structures/SWEP)
gmod_tool/stools/
- (Sandbox only) Scripts placed here will be automatically attempted to be loaded as tools. (Structures/TOOL)
gamemodes/
<gamemodename>/
- A folder containing gamemode files.
entities/
- Basicallylua/
folder that is only loaded when the gamemode is. Subfolders are exactly the same as mentioned above.
gamemode/
- Folder contains all gamemode files.init.lua
andcl_init.lua
must exist in it.