From GMod Wiki
|Syntax||Entity:EmitSound( String filename, Float SoundLevel, Float pitchPercent )|
|A sound is emitted from the entity. SoundLevel and pitchPercent should be 100 if you don't want to change the volume/pitch of the sound.|
|BBCode Link:||[b][url=http://wiki.garrysmod.com/?title=Entity.EmitSound]Entity.EmitSound [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]|
|Description||Uses an entity and emits a sound from it.|
ent:EmitSound("Path/To/Sound.wav", 500, 200)
|Output||ent emits Sound.wav from itself, with 5 times the normal audible distance and 2 times the normal pitch.|
- The path must be relative to the 'sound' directory.
- You can only override the volume and pitch if you use the filename, not the 'game sound' name.
- In some cases, such as calling from an Effect, the sound will be omnipresent instead of locational. In such cases, you can use G.WorldSound to position the sound.
- People sometimes mixup the soundlevel with the volume. Both is not the same but related to each other. The soundlevel is related to the distance it reaches. For more, read this. You see values like SNDLVL_20dB there, where the 20 denotes the soundlevel you have to use with ENT:EmitSound
- 255 is the maximum pitch accepted
- 511 is the maximum soundlevel accepted
- 0 is the minimum accepted value for both soundlevel and pitch