Skip to content
FMFallout Multiplayer Scripting APIScripting guides and API
Global objectServer APIGenerated

Effect

const Effect: object

Defined in: server/api.d.ts:1668

Effects in every player’s game: placed effects that stream like any entity, effect shaders and visual effects on bodies and references, and impacts. Forms are named by form ID (a number or hex string) or by their editor ID in the official masters; an editor ID made only of hex digits reads as a form ID.

exists(effect): boolean

Whether a placed effect is still there: its lifetime may have run out.

number

An ID spawn gave.

boolean

move(effect, position, angle?): boolean

Moves a placed effect in every game, players who come near later included: a lift, a gate, a prop a script carries. Each call is one step; call it each tick for a glide.

number

An ID spawn gave.

Vector3

Where it stands now.

Vector3

Its rotation in radians; kept when left out.

boolean

False when there is no such effect, or it is attached.

playImpact(target, impactSet, options?): void

Plays an impact where a ray from the target lands, in every game where the target is loaded, as ObjectReference.PlayImpactEffect does: the decal, particles and sound of the surface’s material.

string | number | Player | Npc

A player, an NPC, or a placed reference’s form ID.

string | number

A BGSImpactDataSet (IPDS) form ID: what each material shows when hit.

The ray: from the named node of the target (its root when left out), along the direction (straight down by default), for the length in game units (512).

Vector3

number

string

void

playShader(target, shader, seconds?): void

Plays an effect shader over a body or a reference in every game where it is loaded, as EffectShader.Play does.

string | number | Player | Npc

A player, an NPC, or a placed reference’s form ID.

string | number

A TESEffectShader (EFSH) form ID: a glow, a burn, a membrane.

number

How long; until stopShader when left out.

void

playVisual(target, effect, seconds?): void

Attaches a visual effect to a body or a reference in every game where it is loaded, as VisualEffect.Play does.

string | number | Player | Npc

A player, an NPC, or a placed reference’s form ID.

string | number

A BGSReferenceEffect (RFCT) form ID: an art object’s particles or model, with or without a shader.

number

How long; until stopVisual when left out.

void

remove(effect): boolean

Removes a placed effect from every game.

number

An ID spawn gave.

boolean

False when there is no such effect.

spawn(form, position, options?): number

Places an effect every player near it sees, players who come near later included: each game places its own copy while they are in range. Attached, it is a prop: a box carried, a lantern on the back, a flame over a head.

string | number

The base object to place: a fog patch, a smoke column or a fire (the game’s FX statics, movable statics and activators), a hazard (HAZD), a light (LIGH), any other placeable object.

Vector3 | null

Where it stands; null for an attached one, which starts where its body stands.

angle: its rotation in radians. space: the worldspace or interior cell; the body’s when attached, else the Commonwealth. lifetime: seconds until it is removed on its own; it stays until remove when left out. range: how near players must be to have it, 8192 units by default. attach: holds it on a body or a placed reference every frame, on the named node (“WEAPON”, “RArm_Hand”, “Head”; the root when left out), shifted by offset and turned by rotation (radians) in the node’s frame; everyone in the space has it. Give it something without collision, or it pushes what it touches.

Vector3

{ node?: string; offset?: Vector3; rotation?: Vector3; to: Player | Npc | number | string; }

string

Vector3

Vector3

Player | Npc | number | string

number

number

{ interiorCell?: number | string; worldSpace?: number | string; }

number | string

number | string

number

The effect’s ID, for remove; 0 when it could not be made.

stopShader(target, shader): void

Stops an effect shader on a body or a reference.

string | number | Player | Npc

A player, an NPC, or a placed reference’s form ID.

string | number

The shader played.

void

stopVisual(target, effect): void

Takes a visual effect off a body or a reference.

string | number | Player | Npc

A player, an NPC, or a placed reference’s form ID.

string | number

The visual effect played.

void