Skip to content

Events ​

Local events your scripts can listen to. They are raised on the client of the player who hears the sound.

EventArgumentsWhen
tm_sound:soundFinishedidA sound reached its end (a looping sound raises it at the end of every pass).
tm_sound:streamerModeenabledThe player turned streamer mode on or off.
lua
AddEventHandler('tm_sound:soundFinished', function(id)
    if id == 'intro' then StartTheShow() end
end)

With the xsound compatibility setting on, the same moments also raise xsound's xSound:songStopPlaying (with the id) and xsound:streamerMode.

For one sound you can use callbacks instead of events: pass onPlayEnd in the options of PlayUrl, or call onPlayEnd(id, fn) (see Client exports).

Commands ​

CommandDescription
/streamermodeToggles streamer mode for the player: every sound is stopped, new ones are ignored and the mix is muted until it is turned off.