G.CreateSound
From GMod Wiki
Function | |
Syntax |
CreateSound( Entity target, String path ) Where is this used? |
Description: | |
Creates a looping sound object. | |
Returns: | Csoundpatch |
Part of Library: | Global Functions |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.CreateSound]G.CreateSound [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Info
- If a player gets to far away from where the sound is emitted the sound will disappear.
Let's say that an in game radio is playing music, the current sound is 60 sec long. The player walks away from the radio so he/she can't hear the music, the player gets back to the radio after 40 seconds. The player will not hear the music even if there still is 20 seconds left of the song.
- The same sound file cannot be used twice for the same entity - only the latest instance will play.
- As of build #86, CreateSound is affected by Garbage Collection. This means you'll have to make it a global now for your sound to play correctly.
- If you are creating sounds in multiplayer you will have to create them after the client has connected or the sound will not play for that specific client.