Skip to content

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.

areas.update(id: number, changes: Partial<AreaSettings>): Promise<ActionResult>
Name Type Description
id number The ID from areas.create.
changes Partial<AreaSettings> Any of its settings; see areas.create.

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.

gamemodes/my-mode.ts
import { areas } from "nativemp";
for (const area of areas.listAll()) await areas.update(area.id, { colorRgba: 0xFF000060 });