Garry's Mod Wiki

Lua Loading Order

This list shows the order of loading Lua files in Garry's Mod.

GMod combines all scripts into a virtual filesystem (one folder). addon/myaddon/lua/entities/ and gamemodes/base/gamemode/entities/entities/ will be merged with lua/entities/, so therefore the same path and name will override and/or conflict.
Autorun lua files are sorted alphabetically(A-Z) on all OSes before being executed

Client loading order

  • includes/init.lua - Everything from includes/ is included from this file

  • derma/init.lua - Everything from derma/ is included from this file

  • gamemodes/base/gamemode/cl_init.lua - Everything from gamemodes/base/gamemode/ is included from this file

  • autorun/

    • autorun/client/
  • postprocess/

  • vgui/

  • matproxy/

  • skins/default.lua

  • gamemodes/*gamemodename*/gamemode/cl_init.lua - Everything from gamemodes/*gamemodename*/gamemode/ is included from this file

  • weapons/

    • weapons/gmod_tool/stools/
  • entities/

  • effects/

Server loading order

  • includes/init.lua - Everything from includes/ is included from this file

  • gamemodes/base/gamemode/init.lua - Everything from gamemodes/base/gamemode/ is included from this file

  • autorun/

    • autorun/server/

    • autorun/server/sensorbones

  • includes/dev_server_test.lua - Only executed if the -systemtest command line parameters were added.

  • gamemodes/*gamemodename*/gamemode/init.lua - Everything from gamemodes/*gamemodename*/gamemode/ is included from this file

  • weapons/

    • weapons/gmod_tool/stools/
  • entities/

  • effects/