Skip to content

playerCommitObjectEditRequest

Asks your gamemode when a player chooses Save in the object editor. If allowed, the object takes the submitted transform for everyone who can see it.

server.on("playerCommitObjectEditRequest", ({ player, object, transform }) => boolean | void | Promise<boolean | void>)
Name Type Description
player PlayerSnapshot The player editing the object.
object ScriptObject The object at the time of the request.
transform ScriptObjectEditTransform The transform the player proposes.

Any false discards the draft. The server accepts a valid draft when there are no handlers or when every handler returns true or nothing.

Allow saves only while the proposed scale stays within twice the model’s original size.

gamemodes/my-mode.ts
import { server } from "nativemp";
server.on("playerCommitObjectEditRequest", ({ transform }) => transform.scale <= 2);