OutSoundForGroup
Appearance
| 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 |
| GROUP | REQUIRED, either a group object or a group ID number. If not valid, an error message is logged and no sound is played. | |
| SOUND | REQUIRED, 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: | ||