Entity.EmitSound
From GMod Wiki
Function | |
Syntax | Entity:EmitSound( String filename, Float SoundLevel, Float pitchPercent ) |
Description: | |
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. | |
Returns: | nil |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.EmitSound]Entity.EmitSound [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
- 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