Garry's Mod Wiki

CLuaParticle:SetThinkFunction

CLuaParticle:SetThinkFunction

  CLuaParticle:SetThinkFunction( function thinkFunc )

Description

Sets the think function of the particle.

Arguments

1 function thinkFunc
Think function. It has only one argument:

CLuaParticle particle - The particle the think hook is set on

Example

Example on how to use a think function, randomizes the colors of a particle

p:SetNextThink( CurTime() ) -- Makes sure the think hook is used on all particles of the particle emitter p:SetThinkFunction( function( pa ) pa:SetColor( math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ) ) -- Randomize it pa:SetNextThink( CurTime() ) -- Makes sure the think hook is actually ran. end )

Special Pages


Wikis

?

Render Time: 42ms

DB GetPage 24
Generate Html 3
SaveChanges (1) 6
Render Body 0
Render Sidebar 6