Garry's Mod Wiki

surface.PlaySound

surface.PlaySound( string soundfile )

Description

Play a sound file directly on the client (such as UI sounds, etc).

Arguments

1 string soundfile
The path to the sound file, which must be relative to the sound/ folder.

Example

Plays a sound with a given name. The game will look for the file in following places in that order:

  • garrysmod/addons/myaddon/sound/mysound.wav
  • garrysmod/gamemodes/mygamemode/content/sound/mysound.wav
  • garrysmod/sound/mysound.wav
surface.PlaySound( "mysound.wav" )

Page Links


Special Pages


Wikis

?

Render Time: 31ms

DB GetPage 4
Generate Html 3
SaveChanges (1) 8
Render Body 0
Render Sidebar 12