M MY Multiplayer: Wiki
Side
Kind

onClientSoundStarted

ClientEvent

Fired when a sound starts playing on this client or leaves a pause.

addEventHandler("onClientSoundStarted", root, function(string reason) … end)

Handler parameters

NameTypeDescription
reasonstringplay when the sound starts, resumed when it leaves a pause.

Source

The sound element.

play comes from this client's playSound and playSound3D and from a server sound when it starts here. playSFX and playSFX3D do not fire the event.

Example

addEventHandler("onClientSoundStarted", root, function(reason)
    if reason == "play" then
        outputDebugString("sound started: " .. tostring(getSoundLength(source)) .. " s")
    end
end)

See also