areas.update
Changes the settings you give and keeps the rest. Players who see the area see the change at once. players: null
makes it everyone’s again.
Renamed in 0.28 from zones.update; see renamed names.
Signature
Section titled “Signature”areas.update(id: number, changes: Partial<AreaSettings>): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
id |
number |
The ID from areas.create. |
changes |
Partial<AreaSettings> |
Any of its settings; see areas.create. |
Returns
Section titled “Returns”A promise of an ActionResult: applied, or rejected with the codes of
areas.create, or marker-not-found for an ID that is not one of your areas. A rejected update changes nothing.
Example
Section titled “Example”import { areas } from "nativemp";
for (const area of areas.listAll()) await areas.update(area.id, { colorRgba: 0xFF000060 });Related
Section titled “Related”areas.create: make oneareas.destroy: remove itareas.listAll: all of themscriptMarkerUpdated: it changed