Garry's Mod Wiki

Revision Difference

surface.PlaySound#512018

<function name="PlaySound" parent="surface" type="libraryfunc">⤶ <description>Play a sound file directly on the client (such as UI sounds, etc).</description>⤶ <realm>Client and Menu</realm>⤶ <args>⤶ <arg name="soundfile" type="string">The path to the sound file, which must be relative to the sound/ folder.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>⤶ Plays a sound with a given name. The game will look for the file in following places in that order:⤶ * garrysmod/addons/myaddon/sound/mysound.wav⤶ * garrysmod/gamemodes/mygamemode/content/sound/mysound.wav⤶ * garrysmod/sound/mysound.wav⤶ </description>⤶ <code>surface.PlaySound( "mysound.wav" )</code>⤶ ⤶ </example>