Garry's Mod Wiki

CreateParticleSystemNoEntity

  CNewParticleEffect CreateParticleSystemNoEntity( string effect, Vector pos, Angle ang = Angle( 0, 0, 0 ) )

Description

Creates a new particle system, and sets control points 0 and 1 to given position, as well as optionally orientation of CP0 to the given angles. See also CreateParticleSystem

The particle effect must be precached with PrecacheParticleSystem and the file its from must be added via game.AddParticles before it can be used!

Arguments

1 string effect
The name of the effect to create. It must be precached.
2 Vector pos
The position for the particle system.
3 Angle ang = Angle( 0, 0, 0 )
The orientation of the particle system.

Returns

1 CNewParticleEffect
The created particle system.

Example

Creates a big explosion effect at the place the player is looking at.

PrecacheParticleSystem( "explosion_huge_g" ) concommand.Add( "test_particle", function( ply, cmd, arg ) local pos = ply:GetEyeTrace().HitPos CreateParticleSystemNoEntity( "explosion_huge_g", pos ) end )