Graphics::startParticleFxNonLoopedOnPedBone
JavaScript
Summary
Triggers a non-looped particle effect on a specific bone of a ped. The particle's position, rotation, and scale can be customized, along with axis inversion flags.
Syntax
mp.game.graphics.startParticleFxNonLoopedOnPedBone(effectName, ped, offsetX, offsetY, offsetZ, rotX, rotY, rotZ, boneIndex, scale, axisX, axisY, axisZ);
Required Parameters
- effectName: String - The name of the particle effect to play.
- ped: Ped - The ped handle or object on which the effect will be played.
- offsetX: float - X-axis offset from the bone.
- offsetY: float - Y-axis offset from the bone.
- offsetZ: float - Z-axis offset from the bone.
- rotX: float - Rotation around the X-axis.
- rotY: float - Rotation around the Y-axis.
- rotZ: float - Rotation around the Z-axis.
- boneIndex: int - Index of the ped's bone where the effect is applied.
- scale: float - The scale of the particle effect.
- axisX: Boolean - Inverts the effect along the X-axis if true.
- axisY: Boolean - Inverts the effect along the Y-axis if true.
- axisZ: Boolean - Inverts the effect along the Z-axis if true.
Return Value
- 'Boolean' - Returns true if the effect was successfully started.
Example
This example spawns a particle effect ("scr_sh_bong_smoke") on the player's head bone.
const ped = mp.players.local.handle;
const boneIndex = 31086; // Head bone index
const effectName = "scr_sh_bong_smoke";
mp.game.graphics.startParticleFxNonLoopedOnPedBone(
effectName,
ped,
-0.025, 0.13, 0.0, // Offsets
0.0, 0.0, 0.0, // Rotations
boneIndex,
1.0, // Scale
false, false, false // No axis inversion
);
mp.gui.chat.push(`Particle effect "${effectName}" started on ped's head.`);