Garry's Mod Wiki

EmitSentence

EmitSentence( string soundName, Vector position, number entity, number channel = CHAN_AUTO, number volume = 1, number soundLevel = 75, number soundFlags = 0, number pitch = 100 )

Description

Plays a sentence from scripts/sentences.txt

Arguments

1 string soundName
The sound to play
2 Vector position
The position to play at
3 number entity
The entity to emit the sound from. Must be Entity:EntIndex
4 number channel = CHAN_AUTO
The sound channel, see Enums/CHAN.
5 number volume = 1
The volume of the sound, from 0 to 1
6 number soundLevel = 75
The sound level of the sound, see Enums/SNDLVL
7 number soundFlags = 0
The flags of the sound, see Enums/SND
8 number pitch = 100
The pitch of the sound, 0-255

Example

Plays random combine death sound on first player.

EmitSentence( "COMBINE_DIE" .. math.random( 0, 2 ), Entity( 1 ):GetPos(), 1, CHAN_AUTO, 1, 75, 0, 100 )

Page Links


Special Pages


Wikis

?

Render Time: 49ms

DB GetPage 3
Generate Html 23
SaveChanges (1) 8
Render Body 0
Render Sidebar 12