Creates a simple spark particle effect 100 units above where the local player is looking at.
local tr =LocalPlayer():GetEyeTrace()
local pos = tr.HitPos + tr.HitNormal *100-- The origin position of the effectlocal emitter =ParticleEmitter( pos ) -- Particle emitter in this positionfor i =0, 100do-- Do 100 particleslocal part =emitter:Add( "effects/spark", pos ) -- Create a new particle at posif ( part ) thenpart:SetDieTime( 1 ) -- How long the particle should "live"part:SetStartAlpha( 255 ) -- Starting alpha of the particlepart:SetEndAlpha( 0 ) -- Particle size at the end if its lifetimepart:SetStartSize( 5 ) -- Starting sizepart:SetEndSize( 0 ) -- Size when removedpart:SetGravity( Vector( 0, 0, -250 ) ) -- Gravity of the particlepart:SetVelocity( VectorRand() *50 ) -- Initial velocity of the particleendendemitter:Finish()