Garry's Mod Wiki

hook.Run

  vararg hook.Run( string eventName, ... )

Description

Calls all hooks associated with the given event until one returns something other than nil and then returns that data. If no hook returns any data, it will try to call the GAMEMODE:<eventName>; alternative, if one exists.

This function internally calls hook.Call.

See also: gamemode.Call - same as this, but does not call hooks if the gamemode hasn't defined the function.

Arguments

1 string eventName
The event to call hooks for.
2 vararg args
The arguments to be passed to the hooks.

Returns

1 vararg
Return data from called hooks. Limited to 6 return values.