objects.listAll
Lists your gamemode’s objects. The server removes them when the gamemode stops or reloads.
Renamed in 0.28 from objects.all; see renamed names.
Signature
Section titled “Signature”objects.listAll(): readonly ScriptObject[]Parameters
Section titled “Parameters”None.
Returns
Section titled “Returns”An array of ScriptObject. It is a copy: it does not change as objects come and go.
Example
Section titled “Example”import { objects, server } from "nativemp";
for (const object of objects.listAll()) { server.log(`${object.id}: model ${object.model} at ${object.position.join(", ")}`);}Related
Section titled “Related”objects.getById: find one by IDobjects.create: add an objectobjects.destroy: remove an object