fxCreateParticle | Multi Theft Auto: Wiki Skip to content

fxCreateParticle

Client-side
Server-side
Shared

Added in 1.6.0 r22512

Creates the given particles of the specified color. Can be useful for creating flares, toxic fumes, reward effects, etc.

Caution

Depending on the particle, a very large count may cause the game to lag or freeze (50k+).

Note

bubble particle works only in the water.

OOP Syntax Help! I don't understand this!

  • Method:Effect.createParticle(...)

Syntax

bool fxCreateParticle ( ​string particle, ​float posX, ​float posY, ​float posZ, ​float dirX, ​float dirY, ​float dirZ, ​float r, ​float g, ​float b, ​float a, [ ​bool randomizeColors = false, ​int count = 1, ​float brightness = 1.0, ​float size = 0.3, ​bool randomSizes = false, ​float life = 1.0 ] )
Required Arguments
  • particle: The name of the particle to create. See particles list.
  • posX: The world X coordinate where the effect originates.
  • posY: The world Y coordinate where the effect originates.
  • posZ: The world Z coordinate where the effect originates.
  • dirX: The direction X coordinate where the particles flies to.
  • dirY: The direction Y coordinate where the particles flies to.
  • dirZ: The direction Z coordinate where the particles flies to.
  • r: The color (Red) of the particle.
  • g: The color (Green) of the particle.
  • b: The color (Blue) of the particle.
  • a: The color (Alpha) of the particle.
Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.

  • randomizeColors (default: false): Specifies whether the color should be fixed (r,g,b) or randomly calculated for each particle based on the given color. This allows to create colorful effects.
  • count (default: 1): The number of flying particles to create.
  • brightness (default: 1.0): The brightness. Ranges from 0 (almost black) to 1 (normal color).
  • size (default: 0.3): Particles size. If randomSizes is set then when 0 is specified the minimum size is 0.3.
  • randomSizes (default: false): Specifies whether all particles should be the same fixed size or each particle should have a random size.
  • life (default: 1.0): The higher this value, the longer the particles survive before they disappear.

Returns

  • bool: result

Always returns true.

Code Examples

client

This example creates a constant green, toxic fume over the biowell.

setTimer(function()
fxCreateParticle("sand", 1271.76392, 295.11682, 20.65631, 0, 0, 1, 56, 191, 52, 255, false, 5, 1, 1, true)
end, 750, 0)