GSC reference › Built-in
CreateSoundRandom()
Built-in (engine)
Client
Create sound random at the position
Signature
CreateSoundRandom(<position>, <name>, <min wait>, <max wait>)
Parameters
| Name | Required? | Details |
|---|---|---|
| position | Required | The position |
| name | Required | The sound name |
| min wait | Required | The minimum wait time |
| max wait | Required | The maximum wait time |
Example (from Treyarch's docs)
CreateSoundRandom(randSound.origin, randSound.script_sound, randSound.script_wait_min, randSound.script_wait_max)
Real uses in BO3's scripts
Called 1 time in the decompiled scripts. A few, zombies first:
- scripts/shared/audio_shared.csc, line 327
createsoundrandom(randsound.origin, randsound.script_sound, randsound.script_wait_min, randsound.script_wait_max);
Related built-ins
- AllocateSoundRandoms()Allocate a pool of random sounds
- PlaySound()Play the sound at the entity
- RandomFloatRange()Returns a random floating point number r, where min <= r < max
- RandomInt()Returns a random integer between 0 and max-1 inclusive
- RandomIntRange()Returns a random integer r, where min <= r < max
- PlaySoundAtPosition()Play the sound alias from a position
- PlayLoopSound()Play a looping sound with an optional fadetime in seconds.
- StopLoopSound()Stops the looping sound with an optional fadetime.
- RandomFloat()Returns a random floating point number r, where 0 <= r < max
- PlaySoundToPlayer()Play the sound alias as if coming from the entity, so that only one player can hear it
- PlaySoundWithNotify()Play the sound alias as if coming from the entity
- PlayLocalSound()Plays a sound locally
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).