Sound.Play
From Liberty Unleashed Wiki
This function plays a local sound stored in the server files.
Syntax
bool Sound.Play( player plr )
Arguments
- plr - The player to play the sound for
Example
This code will play the sound 'moo.mp3' for a player when they type '/moo'.
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "moo" ) { local sound = FindSound( "moo.mp3" ); if ( sound ) { sound.Open( pPlayer ); sound.Play( pPlayer ); sound.Close( pPlayer ); } } return 1; }
Notes
The event onPlayerCommand was used in this example. More info about this in the corresponding page.