ActionResult
What a function that changes the game returns, as a promise: whether the server did it.
Definition
Section titled “Definition”type ActionResult = | { status: "applied"; createdId?: number; } | { status: "rejected"; code: string } | { status: "timeout" };Values
Section titled “Values”| Status | Means | |
|---|---|---|
status: "applied" |
The server did it; the players’ games follow. createdId is the new ID for objects.create, vehicles.create, pickups.create and the create of text labels, map icons, checkpoints and areas; the virtual world they went to for players.setVirtualWorld and vehicles.setVirtualWorld. |
|
status: "rejected" |
The server did not do it; code says why. Each function’s page lists its codes. |
|
status: "timeout" |
No answer within five seconds (fifteen for players.spawn). |
Codes any function can return:
| Code | Meaning |
|---|---|
session-ended, stale-target |
The player left; see async handlers. |
runtime-ended |
Your gamemode is stopping or reloading. |
too-many-pending-actions |
128 actions are waiting for an answer already. |
runtime-unavailable |
Your gamemode is not connected to the server. |
Related
Section titled “Related”players.setPosition: an example