Garry's Mod Wiki

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( 1e99 ) -- 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( 1e99 ) -- Makes sure the think hook is actually ran. end )

Page Links


Special Pages


Wikis

?

Render Time: 46ms

Session 0
DB GetPage 2
Generate Html 8
SaveChanges 21
Render Body 0
Render Sidebar 14