SetSoundVolume

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

setSoundVolume

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.

Changes the linear volume of a sound owned by the current client resource.

Syntax

bool setSoundVolume(number sound, number volume)

Parameters

Name Type Required Description
sound number yes The resource-owned handle returned by playSound or playSound3D.
volume number yes Finite linear volume from 0 to 1.

Returns

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

Examples

Lower a playing sound:

setSoundVolume(sound, 0.35)

Notes

  • Available only in client-side resource scripts.
  • Handles cannot be shared between resources.