playerAudioZoneChanged
Tells your gamemode when the ambient audio zone a player’s game plays changes, including leaving every zone.
Renamed in 0.28 from audioZoneChange; see renamed names.
Signature
Section titled “Signature”server.on("playerAudioZoneChanged", ({ player, fromZone, toZone }) => void)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerSnapshot |
The player. |
fromZone |
{ name: string; audioId: number } | null |
The zone before, or null. |
toZone |
{ name: string; audioId: number } | null |
The zone now, or null. |
Example
Section titled “Example”import { server } from "nativemp";
server.on("playerAudioZoneChanged", ({ player, toZone }) => { server.log(`${player.name} hears ${toZone?.name ?? "no zone"}`);});Related
Section titled “Related”PlayerSnapshot:audioZonein the snapshot