Garry's Mod Wiki

TOOL

This function or feature is only available in the Sandbox gamemode and its derivatives.

A list of hooks (or callbacks) that are available for you to override in a tool. This is only applicable to sandbox and sandbox-derived gamemodes.

See also: TOOL structure and Tool.

Inherits methods from Tool.

Events

TOOL:BuildCPanel( Panel cpanel )
Called when the tool's control panel needs to be rebuilt. Due to historical reasons, this hook does not provide the tool object as self! See examples.
Called when WEAPON:Deploy of the toolgun is called. This is also called when switching from another tool on the server.
TOOL:DrawHUD()
Called when WEAPON:DrawHUD of the toolgun is called, only when the user has this tool selected.
TOOL:DrawToolScreen( number width, number height )
Called after the default tool screen has been drawn from WEAPON:RenderScreen. If this method exists on the TOOL object table, the default scrolling text will not be drawnMaterials rendered in this hook require $ignorez parameter to draw properly.
Called when WEAPON:Think of the toolgun is called, only when the user has this tool selected.
TOOL:Holster()
Called when WEAPON:Holster of the toolgun is called, as well as serverside when switching between different toolguns.
Called when the user left clicks with the tool.
boolean TOOL:Reload( table tr )
Called when the user presses the reload key with the tool out.
Called when the user right clicks with the tool.
TOOL:Think()
Called when WEAPON:Think of the toolgun is called. This only happens when the tool gun is currently equipped/selected by the player and the selected tool is this tool.