Garry's Mod Wiki

Garry's Mod Wiki

  GM:Initialize()

Description

Called after the gamemode loads and starts.

No entities would be present at the time this hook is called, please see GM:InitPostEntity for a one time fire hook after all map entities have been initialized.

Example

"hi" will be printed to the console when the gamemode initializes.

function GM:Initialize() print( "hi" ) end -- That way you are overriding the default hook. -- You can use hook.Add to make more functions get called on initialization. hook.Add( "Initialize", "some_unique_name", function() print( "Initialization hook called" ) end )
Output: Initialization hook called and hi

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...