sound.Add
Description
Creates a sound script. It can also override sounds, which seems to only work when set on the server.
You can find a list of common sound scripts that are shipped with the game by default here: Common Sounds.
A list of sound scripts can be retrieved with sound.GetTable.
Arguments
Example
Creates a sound script. It will automatically vary in pitch and be played in a given audio channel to better control which sounds mix with which sounds and how.
In this example, the file location could be: (Choose one)
- garrysmod/sound/
phx/explode03.wav
- garrysmod/gamemodes/MyCoolGameMode/content/sound/
phx/explode03.wav
- garrysmod/addons/myCoolAddon/sound/
phx/explode03.wav
- garrysmod/addons/myCoolAddon/gamemodes/MyCoolGameMode/content/sound/
phx/explode03.wav
Output: You can now play your custom sound script with Entity:EmitSound like so: