Jump to content

OutSoundForGroup

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (outSoundForGroup – created via PowerShell script (2025-11-11T21:12:38Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: outSoundForGroup
Function Description: Plays a sound for a specified group, either by group object or group ID. Supports both a single sound string or a table of sound strings, selecting randomly if a table is provided. Validates input to ensure the group is valid and the sound is properly defined.
File Location: cmm.soundFunctions.lua
Syntax: CMM.outSoundForGroup( table or number GROUP , table or string SOUND )
Return Value: nil
Parameters: Name Description
GROUPREQUIRED, either a group object or a group ID number. If not valid, an error message is logged and no sound is played.
SOUNDREQUIRED, either a string path to a sound file or a table of sound file paths. A random entry is selected from the table if provided; otherwise, the string is used directly.
Example: CMM.outSound_ForGroup(Group.getByName("TEST"), CMM.SOUNDS.XPBanked)
Example Description: Plays a sound for the group named "TEST" using the XPBanked sound from CMM.SOUNDS, leveraging group object validation and sound selection logic.
Related Functions:
Notes: