Garry's Mod Wiki

Garry's Mod Wiki

  CLuaParticle:SetThinkFunction( function thinkFunc )

Description

Sets the think function of the particle.

Arguments

1 function thinkFunc
Think function.
Function argument(s):
1 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 )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...