Events
Local events your scripts can listen to. They are raised on the client of the player who hears the sound.
| Event | Arguments | When |
|---|---|---|
tm_sound:soundFinished | id | A sound reached its end (a looping sound raises it at the end of every pass). |
tm_sound:streamerMode | enabled | The 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
| Command | Description |
|---|---|
/streamermode | Toggles streamer mode for the player: every sound is stopped, new ones are ignored and the mix is muted until it is turned off. |