Garry's Mod Wiki

Revision Difference

Lua_Folder_Structure#517836

<removed>This article contains outdated/incorrect information.</removed> The structure of the Lua folder can be confusing. Here's a rundown: &lt;ul&gt;&lt;li&gt; **lua** &lt;ul&gt;&lt;li&gt; **autorun** - all files are automatically loaded on Lua start. &lt;ul&gt;&lt;li&gt; **client** - autorun client scripts. &lt;/li&gt;&lt;li&gt; **server** - autorun server scripts. &lt;/li&gt;&lt;li&gt; **shared** - autorun shared (both cl_ and sv_) scripts. &lt;/li&gt;&lt;/ul&gt;⤶ &lt;/li&gt;&lt;li&gt; **includes** - init.lua loaded on start. &lt;ul&gt;&lt;li&gt; **enum** - Loaded on start. Contains all enum files. &lt;/li&gt;&lt;li&gt; **extensions** - Loaded on start. Extends existing libraries and types. &lt;/li&gt;&lt;li&gt; **modules** - Contains all modules. &lt;/li&gt;&lt;/ul&gt;⤶ &lt;/li&gt;&lt;li&gt; _**downloaded** - Clientside downloaded files &lt;ul&gt;&lt;li&gt; **.cache** - Contains cached versions of all downloaded files (to prevent constantly redownloading) &lt;/li&gt;&lt;/ul&gt;⤶ &lt;/li&gt;&lt;li&gt; **postprocess** - Run by client on startup &lt;/li&gt;&lt;/ul&gt;⤶ <ul><li> **lua** <ul><li> **autorun** - all files are automatically loaded on Lua start. <ul><li> **client** - autorun client scripts. </li><li> **server** - autorun server scripts. </li><li> **shared** - autorun shared (both cl_ and sv_) scripts. </li></ul>⤶ </li><li> **includes** - init.lua loaded on start. <ul><li> **enum** - Loaded on start. Contains all enum files. </li><li> **extensions** - Loaded on start. Extends existing libraries and types. </li><li> **modules** - Contains all modules. </li></ul>⤶ </li><li> _**downloaded** - Clientside downloaded files <ul><li> **.cache** - Contains cached versions of all downloaded files (to prevent constantly redownloading) </li></ul>⤶ </li><li> **postprocess** - Run by client on startup </li></ul>⤶ ---- ⤶ &lt;/li&gt;&lt;li&gt; **gamemodes** - Contains gamemodes. Gamemodes are only run when they're required (either by the map setting the gamemode or by another gamemode being derived from that gamemode). &lt;ul&gt;&lt;li&gt; **base** - Entities in this folder exist in every Gamemode &lt;ul&gt;&lt;li&gt; **entities** - All scripted items come under this directory. &lt;ul&gt;&lt;li&gt; **weapons** - Scripted Weapons &lt;/li&gt;&lt;li&gt; **entities** - Scripted Entities &lt;/li&gt;&lt;li&gt; **effects** - Scripted Effects &lt;/li&gt;&lt;/ul&gt;⤶ &lt;/li&gt;&lt;li&gt; **gamemode** - All Gamemode scripts go in here. &lt;/li&gt;&lt;/ul&gt;⤶ &lt;/li&gt;&lt;li&gt; **other gamemodes** &lt;ul&gt;&lt;li&gt; **entities** - All scripted items come under this directory. &lt;ul&gt;&lt;li&gt; **weapons** - Scripted Weapons &lt;/li&gt;&lt;li&gt; **entities** - Scripted Entities &lt;/li&gt;&lt;li&gt; **effects** - Scripted Effects &lt;/li&gt;&lt;/ul&gt;⤶ &lt;/li&gt;&lt;li&gt; **gamemode** - All Gamemode scripts go in here. &lt;/li&gt;&lt;/ul&gt;⤶ &lt;/li&gt;&lt;/ul&gt;⤶ &lt;/li&gt;&lt;/ul&gt;⤶ ⤶ </li><li> **gamemodes** - Contains gamemodes. Gamemodes are only run when they're required (either by the map setting the gamemode or by another gamemode being derived from that gamemode). <ul><li> **base** - Entities in this folder exist in every Gamemode <ul><li> **entities** - All scripted items come under this directory. <ul><li> **weapons** - Scripted Weapons </li><li> **entities** - Scripted Entities </li><li> **effects** - Scripted Effects </li></ul>⤶ </li><li> **gamemode** - All Gamemode scripts go in here. </li></ul>⤶ </li><li> **other gamemodes** <ul><li> **entities** - All scripted items come under this directory. <ul><li> **weapons** - Scripted Weapons </li><li> **entities** - Scripted Entities </li><li> **effects** - Scripted Effects </li></ul>⤶ </li><li> **gamemode** - All Gamemode scripts go in here. </li></ul>⤶ </li></ul>⤶ </li></ul>⤶ `Source: [GMod Wiki](https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index66fb-2.html)`