Garry's Mod Wiki

ENTITY:Think

  boolean ENTITY:Think()

Description

Called every frame on the client. Called about 5-6 times per second on the server.

You may need to call Entity:Spawn to get this hook to run server side.

You can force it to run at servers tickrate using the example below.

Returns

1 boolean
Return true if you used Entity:NextThink to override the next execution time.

Example

Force the think hook to run at the maximum frequency. This is generally only used for anim type entities, if the entity has to play model animations/sequences.

ENT.AutomaticFrameAdvance = true -- Must be set on client function ENT:Think() -- Do stuff self:NextThink( CurTime() ) -- Set the next think to run as soon as possible, i.e. the next frame. return true -- Apply NextThink call end