Skip to content

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.

server.on("playerInteriorChanged", ({ player, fromInterior, toInterior }) => void)
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.
gamemodes/my-mode.ts
import { screen, server } from "nativemp";
server.on("playerInteriorChanged", ({ player, toInterior }) => {
if (toInterior !== 0) screen.showGameText("~y~No weapons inside", { player, durationMs: 2000, style: 3 });
});