- Documentation
- Client functions
- setSoundMaxDistance
Function
setSoundMaxDistance
Sets the distance from which a 3D sound can no longer be heard (20 m by default).
Syntax
bool setSoundMaxDistance(sound theSound, float distance)Arguments
theSoundsound- The sound.
distancefloat- Metres, greater than 0.
Returns
true on success.
Example
local siren = playSound3D("audio/siren.wav", 1555, -1675, 16, true)
setSoundMaxDistance(siren, 120)