surface.PlaySound
From GMod Wiki
| Function | |
| Syntax |
surface.PlaySound( String filepath ) Where is this used? |
| Description: | |
| Plays a sound file on the client. | |
| Returns: | nil |
| Part of Library: | surface |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Surface.PlaySound]Surface.PlaySound [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Plays the sound /music/hl2_song20_submix0.mp3. |
|---|---|
| Used on | |
| Code | surface.PlaySound( "/music/hl2_song20_submix0.mp3" ) |
| Output | A sound is played. |
Additional Notes
- Sound file names can be found via Hammer's sound browsing utility or by browsing the GCF files.
- Only one sound can be played at a time.
- Has the same effect as typing "play [filename]" into your Console
- Do remember to change any "\" to "/" as using "\" will create lua errors.