SetVoiceLevels
The voice levels players switch between with the voice level key - a whisper, a shout, as many as you like.
levels is a list of {name = "...", range = metres} in the order the key goes through them (16 at most). A level
without a range (or 0) carries as far as the server’s default (SetVoiceRange). defaultLevel - a number from 1 or
a level’s name - is where every player starts; without it, the first level that has no range of its own.
A player picks the next level with the key (it goes round), the HUD shows it, and the level’s range becomes their own
(SetPlayerVoiceRange, which still sets it directly until their next switch). A new list keeps every player at their
place in it when the new list has one; {} takes the levels away - the key does nothing and everyone’s own range goes
back to the default. Set it in OnGameModeInit; a reload of the mode clears it.
Syntax
Section titled “Syntax”SetVoiceLevels(levels [, defaultLevel])| Parameter | Type | |
|---|---|---|
levels |
table | {{name = "Whisper", range = 3}, ...}; {} = no levels |
defaultLevel |
number|string | where everyone starts - a number from 1 or a level’s name (optional) |
Example
Section titled “Example”function OnGameModeInit() SetVoiceLevels({ { name = "Whisper", range = 3 }, { name = "Normal" }, -- the server's [voice] range { name = "Shout", range = 50 }, }, "Normal")endSee also
Section titled “See also”GetVoiceLevels · SetPlayerVoiceLevel · OnPlayerVoiceLevelChange · the Voice chat group of the index
