Garry's Mod Wiki

Revision Difference

ENTITY:Think#514572

<function name="Think" parent="ENTITY" type="hook">⤶ <ishook>yes</ishook>⤶ <description>⤶ Called every frame on the client.⤶ Called every tick on the server.⤶ ⤶ <note>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.</note>⤶ </description>⤶ <realm>Shared</realm>⤶ <predicted>No</predicted>⤶ <rets>⤶ <ret name="" type="boolean">Return true if you used <page>Entity:NextThink</page> to override the next execution time.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>⤶ Force the think hook to run at the maximum frequency.⤶ This is generally only used for anim entities, if the entity has to play any animations.⤶ </description>⤶ <code>⤶ ENT.AutomaticFrameAdvance = true -- Must be set on client⤶ ⤶ function ENT:Think()⤶ -- Do stuff⤶ ⤶ self:NextThink( CurTime() )⤶ return true⤶ end⤶ </code>⤶ ⤶ </example>