ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. createParticleEffect

Function

createParticleEffect

Server and clientParticlesTrilogy Hub only

A short effect: the emitter releases particles for the given time and removes itself once the last one fades. No need to destroy it. On the server, every player nearby sees the effect.

Syntax

element createParticleEffect(float x, float y, float z, string|table settings [, float seconds = 2, table overrides = nil])

Arguments

xfloat
Position X.
yfloat
Position Y.
zfloat
Position Z.
settingsstring|table
A preset name or a settings table.
secondsfloat, optional = 2
How long the emitter releases particles.
overridestable, optional = nil
Fields that replace the preset's settings.

Returns

The emitter or false.

Example

Sparks where a bullet hits.

addEventHandler("onClientPlayerWeaponFire", localPlayer, function(weapon, hx, hy, hz)
    createParticleEffect(hx, hy, hz, "sparks", 0.5, { rate = 300 })
end)

See also