Skip to content

scriptObjectDestroyed

Tells your gamemode that one of its objects was removed with objects.destroy.

server.on("scriptObjectDestroyed", ({ object }) => void)
Name Type Description
object ScriptObject The object as it was.

objects.getById(object.id) already returns undefined. Objects removed while the gamemode loads do not send it.

gamemodes/my-mode.ts
import { server } from "nativemp";
server.on("scriptObjectDestroyed", ({ object }) => {
server.log(`Removed object ${object.id}`);
});