setSoundVolume
Shared
Changes a sound's volume. On a 3D sound, it still falls with distance. On the server, the change is sent to every client.
bool setSoundVolume(sound sound, float volume)
Parameters
| Name | Type | Description |
|---|---|---|
| sound | sound | The sound element. On the client a dui element also works, for the browser's sound. |
| volume | float | The volume, where 1 is normal and 0 is silent. |
Returns
true if the sound was found, false otherwise.
Example
local music = playSound("sounds/track.mp3", true)
setSoundVolume(music, 0.3)