surface.PlaySound

From Garry's Mod
Jump to: navigation, search
 surface.PlaySound( )

Contents

Description

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

Arguments

string soundfile

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

Examples

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" )


Personal tools
Navigation