Garry's Mod Wiki

Revision Difference

sound.Play#512919

<function name="Play" parent="sound" type="libraryfunc">⤶ <description>⤶ Plays a sound from the specified position in the world.⤶ If you want to play a sound without a position, such as a UI sound, use <page>surface.PlaySound</page> instead.⤶ </description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="Name" type="string">A string path to the sound.</arg>⤶ <arg name="Pos" type="Vector">A vector describing where the sound should play.</arg>⤶ <arg name="Level" type="number">Sound level in decibels. 75 is normal. Ranges from 20 to 180, where 180 is super loud. This affects how far away the sound will be heard.</arg>⤶ <arg name="Pitch" type="number">An integer describing the sound pitch. Range is from 0 to 255. 100 is normal pitch.</arg>⤶ <arg name="Volume" type="number">A float ranging from 0-1 describing the output volume of the sound.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Plays an explosion sound at the (0, 0, 0) map coordinates.</description>⤶ <code>sound.Play( "ambient/explosions/exp1.wav", Vector(0, 0, 0) )</code>⤶ ⤶ </example>