Skip to content

SpawnEffect

Plays one of the game’s particle effects at a point for everyone nearby.

name is a particle effect of the game’s libraries by its full name - WH_Particels.smokes.smithery, professions.blacksmith.forge_fire, cinematics.fires.fire_big_a … (the particle effects list all 2,600). scale 1 plays it as authored. dir is the effect’s up - {x, y, z} or three numbers; straight up (0, 0, 1) without it. A looping effect plays until the player’s level unloads. world is the virtual world (0, the shared one, without it).

SpawnEffect(name, x, y, z [, scale, dir, world])
Parameter Type
name string the particle effect’s full name
x number metres
y number metres
z number metres
scale number 1 = as authored (optional)
dir table | number the effect’s up as {x=, y=, z=} (or three numbers dx, dy, dz in its place); straight up without (optional)
world number the virtual world (0) (optional)

number - how many players got it; 0 for an empty name or nobody in range

-- the smithy's smoke two metres ahead of the player
local x, y, z = GetPlayerPos(pid)
local r = math.rad(GetPlayerYaw(pid))
SpawnEffect("WH_Particels.smokes.smithery", x - math.sin(r) * 2, y + math.cos(r) * 2, z)
-- a big fire, half size, in a private arena world
SpawnEffect("cinematics.fires.fire_big_a", fx, fy, fz, 0.5, {x = 0, y = 0, z = 1}, arenaWorld)

SpawnDecal · PlaySound · CreateProp · the Effects and sounds group of the index