SetSoundLooped

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

setSoundLooped

AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.

Enables or disables looping for a sound owned by the current client resource.

Syntax

bool setSoundLooped(number sound, bool looped)

Parameters

Name Type Required Description
sound number yes The resource-owned handle returned by playSound or playSound3D.
looped bool yes True to loop or false to use one-shot playback.

Returns

Returns true when the owned sound is updated; otherwise returns false.

Examples

Keep ambient audio looping:

setSoundLooped(ambientSound, true)

Notes

  • Available only in client-side resource scripts.