StartSound (script event)

From modwiki

Jump to: navigation, search

Description

Plays the sound specified by the snd_* key/value pair on the channel and returns the length of the sound.

Usage

In your script type...

float startSound( string sound, float channel, float netSync )

Parameters

  • [sound] - The sound to play from this entity.
  • [channel] - The channel to play this sound on.
  • [netSync] - Whether to play this sound across the network or not.

Examples

 
$my_entity.startSound("campbell_fs", 1, 1);

Notes

This script event does not return any values.

This is the preferred method for playing sounds on an entity since it ensures that the sound is precached.


Personal tools
Main