Garry's Mod Wiki

sound.Play

sound.Play( string Name, Vector Pos, number Level, number Pitch, number Volume )

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 surface.PlaySound instead.

Arguments

1 string Name
A string path to the sound.
2 Vector Pos
A vector describing where the sound should play.
3 number Level
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.
4 number Pitch
An integer describing the sound pitch. Range is from 0 to 255. 100 is normal pitch.
5 number Volume
A float ranging from 0-1 describing the output volume of the sound.

Example

Plays an explosion sound at the (0, 0, 0) map coordinates.

sound.Play( "ambient/explosions/exp1.wav", Vector(0, 0, 0) )

Page Links


Special Pages


Wikis

?

Render Time: 58ms

DB GetPage 5
Generate Html 13
SaveChanges (1) 20
Render Body 0
Render Sidebar 13