scriptObjectCreated
Tells your gamemode that one of its objects was placed with objects.create.
Signature
Section titled “Signature”server.on("scriptObjectCreated", ({ object }) => void)Parameters
Section titled “Parameters”| 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.
Example
Section titled “Example”import { objects, server } from "nativemp";
server.on("scriptObjectCreated", ({ object }) => { server.log(`Created object ${object.id}; ${objects.getById(object.id)?.model} is now listed`);});Related
Section titled “Related”objects.create: create an objectscriptObjectDestroyed: an object was removed