Garry's Mod Wiki

Sound

string Sound( string soundPath )

Description

Runs util.PrecacheSound and returns the string.

util.PrecacheSound does nothing and therefore so does this function

Arguments

1 string soundPath
The soundpath to precache

Returns

1 string
The string passed as the first argument

Example

From entities/sent_ball.lua

local BounceSound = Sound( "garrysmod/balloon_pop_cute.wav" ) function ENT:PhysicsCollide( data, physobj ) -- Play sound on bounce if ( data.Speed > 60 && data.DeltaTime > 0.2 ) then sound.Play( BounceSound, self:GetPos(), 75, math.random( 90, 120 ), math.Clamp( data.Speed / 150, 0, 1 ) ) ...

Page Links


Special Pages


Wikis

?

Render Time: 26ms

Session 0
DB GetPage 3
Generate Html 1
SaveChanges 8
Render Body 0
Render Sidebar 11