- Documentation
- Client functions
- fxCreateParticle
Function
fxCreateParticle
Creates particles with a given colour, size and lifetime.
Syntax
bool fxCreateParticle(string name, float x, float y, float z [, float dirX = 0, float dirY = 0, float dirZ = 0, float size = 1, int r = 255, int g = 255, int b = 255, int a = 255, bool randomizeColors = false, int count = 1, float brightness = 1, int lifetime = 1000])Arguments
namestring- Game particle name.
xfloat- X position.
yfloat- Y position.
zfloat- Z position.
dirXfloat, optional = 0- Direction X.
dirYfloat, optional = 0- Direction Y.
dirZfloat, optional = 0- Direction Z.
sizefloat, optional = 1- Size.
rint, optional = 255- Red.
gint, optional = 255- Green.
bint, optional = 255- Blue.
aint, optional = 255- Alpha.
randomizeColorsbool, optional = false- Random shades.
countint, optional = 1- Number of particles.
brightnessfloat, optional = 1- Brightness.
lifetimeint, optional = 1000- Lifetime in milliseconds.
Returns
true if the particles were created.
Example
local x, y, z = getElementPosition(localPlayer)
fxCreateParticle("sparks", x, y, z + 1, 0, 0, 1, 0.5, 255, 180, 0, 255, false, 20, 1, 800)
Notes
The game does not draw this yet. In this version the function returns false.