ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. getSoundHeardVolume

Function

getSoundHeardVolume

ClientSound (client)Trilogy Hub only

Returns the volume the player actually hears: after distance from the camera and after the volume slider in the settings.

Syntax

float getSoundHeardVolume(sound theSound)

Arguments

theSoundsound
The sound.

Returns

Volume 0-1 or false.

Example

addEventHandler("onClientRender", root, function()
    if isElement(radio) then
        dxDrawText(("Radio: %d%%"):format(getSoundHeardVolume(radio) * 100), 20, 300)
    end
end)