ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. createEffect

Function

createEffect

Creates a persistent game particle effect (e.g. smoke, fire, a fountain) at a point in the world.

Syntax

effect createEffect(string name, float x, float y, float z [, float rX = 0, float rY = 0, float rZ = 0, float drawDistance = 100, bool soundEnable = true])

Arguments

namestring
The game effect name, e.g. "smoke30lit".
xfloat
X position.
yfloat
Y position.
zfloat
Z position.
rXfloat, optional = 0
X rotation in degrees.
rYfloat, optional = 0
Y rotation in degrees.
rZfloat, optional = 0
Z rotation in degrees.
drawDistancefloat, optional = 100
Draw distance.
soundEnablebool, optional = true
Whether the effect has sound.Different default in MTA:SA: bool soundEnable = false

Differences from MTA:SA

  • Arguments in a different colour differ from MTA:SA.

In MTA:SA

createEffect(string name, float x, float y, float z, float rX, float rY, float rZ, float drawDistance = 0, bool soundEnable = false)

Returns

An effect handle or false.

Example

local smoke = createEffect("smoke30lit", 2490, -1670, 13)
setTimer(destroyEffect, 30000, 1, smoke)

Notes

The game does not draw this yet. The handle is created and keeps its settings, but in this version the effect does not appear in the world.

See also