Skip to content

playerDied

Tells your gamemode when a player dies.

Renamed in 0.28 from death; see renamed names.

server.on("playerDied", ({ player, position, killer, weapon }) => void)
Name Type Description
player PlayerSnapshot The player.
position Vector3 Where they died.
killer PlayerSnapshot | null The player whose game reported the last hit on this one within 5 seconds, or null without one.
weapon number | null That hit’s weapon type, or null.

A kill feed.

gamemodes/my-mode.ts
import { chat, server } from "nativemp";
server.on("playerDied", ({ player, killer }) => {
chat.sendServerMessage(killer ? `${killer.name} killed ${player.name}.` : `${player.name} is wasted.`);
});