Garry's Mod Wiki

GM:Think

  GM:Think()

Description

Called every rendered frame on client, except when the game is paused.

Called every game tick on the server. This will be the same as GM:Tick on the server when there is no lag, but will only be called once every processed server frame during lag. CurTime is guaranteed to be different with each call to this hook on the server.

See GM:Tick for a hook that runs every tick on both the client and server.

On server, this hook WILL NOT run if the server is empty, unless you set the ConVar sv_hibernate_think to 1.

Example

hook.Add( "Think", "MyCoolThinkFunction", function() -- Do something every frame/tick end )