Garry's Mod Wiki

Entity:NextThink

Entity:NextThink( number timestamp )

Description

In the case of a scripted entity, this will cause the next ENTITY:Think event to be run at the given time.

Does not work clientside! Use Entity:SetNextClientThink instead.

This does not work with SWEPs or Nextbots.

Arguments

1 number timestamp
The relative to CurTime timestamp, at which the next think should occur.

Example

Prints 'Hello, World!' in console and sleeps for a second.

function ENT:Think() print("Hello, World!") self:NextThink( CurTime() + 1 ) return true -- Note: You need to return true to override the default next think time end
Output: Hello, World! every second the entity exists in the world.

Page Links


Special Pages


Wikis

?

Render Time: 32ms

Session 0
DB GetPage 2
Generate Html 7
SaveChanges 15
Render Body 0
Render Sidebar 6