G.Sound
From GMod Wiki
Function | |
Syntax |
Sound( String soundname ) Where is this used? |
Description: | |
Uses util.PrecacheSound on the string and then returns said string. Just a utility function. | |
Returns: | String soundname. |
Part of Library: | Global Functions |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.Sound]G.Sound [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | Precaches a sound. |
---|---|
Used on | |
Code | local snd = Sound("Weapon_SMG1.Single") print(snd) |
Output | 'Weapon_SMG1.Single' printed in console. |
Additional Notes
- Should not be called inside of functions since you only need to precache a sound once. Usually used outside of functions to define customizable sounds.
- When using rcon lua_run in multiplayer use [[ ]] and not ' ', using ' ' causes the server to crash.