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.
Signature
Section titled “Signature”server.on("playerLeftArea", ({ player, area }) => void)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerSnapshot |
The player. |
area |
Area |
The area, from areas.create. Its old name zone still works, with a warning. |
Example
Section titled “Example”import { screen, server } from "nativemp";
server.on("playerLeftArea", ({ player }) => { screen.showGameText("~r~You left the safe zone", { player, durationMs: 2000, style: 3 });});Related
Section titled “Related”playerEnteredArea: they came inPlayerAreaPayload- World markers: when the events come