playerInteriorChanged
Tells your gamemode that a player’s game went into or out of an interior: through one of the game’s own doors, or
because your gamemode moved them with players.setPosition or
players.spawn. The player’s game reports it.
Signature
Section titled “Signature”server.on("playerInteriorChanged", ({ player, fromInterior, toInterior }) => void)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerSnapshot |
The player, already in the new interior. |
fromInterior |
number |
The interior they were in: 0 outside, 1 to 18 an interior’s. |
toInterior |
number |
The interior they are in now. |
Example
Section titled “Example”import { screen, server } from "nativemp";
server.on("playerInteriorChanged", ({ player, toInterior }) => { if (toInterior !== 0) screen.showGameText("~y~No weapons inside", { player, durationMs: 2000, style: 3 });});Related
Section titled “Related”PlayerSnapshot:interiorPlayerInteriorChangedPayload