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.
Signature
Section titled “Signature”server.on("playerCommitObjectEditRequest", ({ player, object, transform }) => boolean | void | Promise<boolean | void>)Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”Any false discards the draft. The server accepts a valid draft when there are no handlers or when every handler returns true or nothing.
Example
Section titled “Example”Allow saves only while the proposed scale stays within twice the model’s original size.
import { server } from "nativemp";
server.on("playerCommitObjectEditRequest", ({ transform }) => transform.scale <= 2);