Garry's Mod Wiki

Revision Difference

Global.EmitSentence#514800

<function name="EmitSentence" parent="Global" type="libraryfunc">⤶ <description>Plays a sentence from scripts/sentences.txt</description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="soundName" type="string">The sound to play</arg>⤶ <arg name="position" type="Vector">The position to play at</arg>⤶ <arg name="entity" type="number">The entity to emit the sound from. Must be &lt;page&gt;Entity:EntIndex&lt;/page&gt;</arg>⤶ <arg name="channel" type="number" default="CHAN_AUTO">The sound channel, see &lt;page&gt;CHAN&lt;/page&gt;.</arg>⤶ <arg name="volume" type="number" default="1">The volume of the sound, from 0 to 1</arg>⤶ <arg name="soundLevel" type="number" default="75">The sound level of the sound, see &lt;page&gt;SNDLVL&lt;/page&gt;</arg>⤶ <arg name="soundFlags" type="number" default="0">The flags of the sound, see &lt;page&gt;SND&lt;/page&gt;</arg>⤶ <arg name="pitch" type="number" default="100">The pitch of the sound, 0-255</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Plays random combine death sound on first player.</description>⤶ <code>EmitSentence( "COMBINE_DIE" .. math.random( 0, 3 ), Entity(1):GetPos(), 1, CHAN_AUTO, 1, 75, 0, 100 )</code>⤶ ⤶ </example>