OnClientSoundStopped: Difference between revisions
Jump to navigation
Jump to search
OpenIDUser34 (talk | contribs) No edit summary |
No edit summary |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Client event}} | {{Client event}} | ||
__NOTOC__ | __NOTOC__ | ||
{{New items|3.0140|1.4| | |||
This event is triggered when a '''sound''' is stopped. | This event is triggered when a '''sound''' is stopped. | ||
}} | |||
==Parameters== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 8: | Line 9: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''reason''': the reason the '''sound''' was stopped, can be "finished", "paused" or " | *'''reason''': the reason the '''sound''' was stopped, can be "finished", "paused", "destroyed" or "disabled". | ||
==Source== | ==Source== | ||
Line 26: | Line 27: | ||
end | end | ||
addEventHandler ( "onClientSoundStopped", getRootElement(), onSoundStopped ) | addEventHandler ( "onClientSoundStopped", getRootElement(), onSoundStopped ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 20:35, 2 September 2019
This event is triggered when a sound is stopped.
Parameters
string reason
- reason: the reason the sound was stopped, can be "finished", "paused", "destroyed" or "disabled".
Source
The source of this event is the sound's element.
Example
This example outputs the reason the sound stopped.
function onSoundStopped ( reason ) if ( reason == "destroyed" ) then outputChatBox ( "sound destroyed" ) elseif ( reason == "finished" ) then outputChatBox ( "end of sound" ) elseif ( reason == "paused" ) then outputChatBox ( "sound paused" ) end end addEventHandler ( "onClientSoundStopped", getRootElement(), onSoundStopped )
See Also
Client sound events
- onClientSoundBeat
- onClientSoundChangedMeta
- onClientSoundFinishedDownload
- onClientSoundStarted
- onClientSoundStopped
- onClientSoundStream
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled