Garry's Mod Wiki

ENTITY:Think

boolean ENTITY:Think()

Description

Called every frame on the client. Called every tick on the server.

You may need to call Entity:Spawn to get this hook to run server side.
By default, it runs about 5-6 times per second on the server, but 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

Page Links


Special Pages


Wikis

?

Render Time: 41ms

DB GetPage 4
Generate Html 3
SaveChanges (1) 13
Render Body 0
Render Sidebar 12