Skip to content

playerLeftArea

Tells your gamemode that a player went out of one of your areas, died in it, or it stopped being for them (moved to another interior or virtual world). None comes when the area is destroyed or the player leaves the server: listen to scriptMarkerDestroyed and playerDisconnected for those.

Renamed in 0.28 from zoneLeave; see renamed names.

server.on("playerLeftArea", ({ player, area }) => void)
Name Type Description
player PlayerSnapshot The player.
area Area The area, from areas.create. Its old name zone still works, with a warning.
gamemodes/my-mode.ts
import { screen, server } from "nativemp";
server.on("playerLeftArea", ({ player }) => {
screen.showGameText("~r~You left the safe zone", { player, durationMs: 2000, style: 3 });
});