Skip to content

scriptObjectCreated

Tells your gamemode that one of its objects was placed with objects.create.

server.on("scriptObjectCreated", ({ object }) => void)
Name Type Description
object ScriptObject The object.

objects.getById and objects.listAll already have it. Objects created while the gamemode loads do not send it: use the result of objects.create there.

gamemodes/my-mode.ts
import { objects, server } from "nativemp";
server.on("scriptObjectCreated", ({ object }) => {
server.log(`Created object ${object.id}; ${objects.getById(object.id)?.model} is now listed`);
});