M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
soundsoundThe sound element. On the client a dui element also works, for the browser's sound.
volumefloatThe 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)

See also