Ped::setSynchronizedSceneLooped
JavaScript
The setSynchronizedSceneLooped function is used to set a synchronized scene to loop or stop looping based on the toggle parameter. This can be particularly useful for animations or sequences that need to be repeated continuously, such as background activities or idle loops.
Required Params
- sceneID: int – The ID of the synchronized scene.
- toggle: boolean –
trueto loop the scene,falseto play once.
Return Value
- Undefined – This function does not return a value.
Syntax
mp.game.ped.setSynchronizedSceneLooped(sceneID, toggle);
Example
// Example usage of setSynchronizedSceneLooped
const sceneID = mp.game.ped.createSynchronizedScene(x, y, z, rotX, rotY, rotZ, 2); // Sample scene creation
mp.game.ped.setSynchronizedSceneLooped(sceneID, true); // Loop the scene