Skip to content
M2O Scripting APIScripting reference
Global objectServer APIGenerated

Voice

const Voice: object

Defined in: server/api.d.ts:2726

Server-side proximity voice rules: how far voice carries, and who may talk to or hear whom.

getPlayerRange(player): number

Reads how far a player’s voice carries, with the server-wide default already resolved.

Entity

Player to query.

number

Radius in world units.

getRange(): number

Reads the server-wide proximity range.

number

Radius in world units.

isLocallyMuted(listener, target): boolean

Checks a one-way mute.

Entity

Player doing the muting.

Entity

Player being muted.

boolean

True when the listener does not receive the target.

isPlayerDeaf(player): boolean

Checks the server-wide deafen flag.

Entity

Player to query.

boolean

True when the player receives nobody’s voice.

isPlayerMuted(player): boolean

Checks the server-wide mute flag.

Entity

Player to query.

boolean

True when the player’s voice reaches nobody.

isPlayerVoiceEnabled(player): boolean

Checks whether a player left voice chat enabled in their own client settings. A preference, not a permission: use setPlayerMuted or setPlayerDeaf to enforce anything.

Entity

Player to query.

boolean

True unless the player turned voice chat off.

setLocalMute(listener, target, muted): void

One-way mute between two players, enforced by the server rather than the client.

Entity

Player who stops hearing the target.

Entity

Player the listener stops hearing.

boolean

True to mute, false to restore.

void

setPlayerDeaf(player, deaf): void

Server-wide deafen: a deaf player receives nobody.

Entity

Player to deafen or undeafen.

boolean

True to stop them receiving anyone’s voice.

void

setPlayerMuted(player, muted): void

Server-wide mute: a muted player’s voice reaches nobody.

Entity

Player to mute or unmute.

boolean

True to stop their voice reaching anyone.

void

setPlayerRange(player, range): void

Overrides how far one player’s voice carries, for whisper and shout modes.

Entity

Player whose voice carries the given distance.

number

Audibility radius in world units; values <= 0 return them to the server-wide range.

void

setRange(range): void

Sets how far voice carries for talkers with no override of their own. Connected clients are told, so their playback fades out at the same distance.

number

Audibility radius in world units; values <= 0 restore the default of 25.

void