Noverwyn Documentation
API set:
148

‹ All natives

Namespace: ZONE API set: server Language: Luau Improve

map.zones

map.zones(filter: table?): { Zone }

Returns the zones drawn in the map.

Parameters#

  • filter (table, optional): fields that data must contain, for example { type = "classroom" }. Without a filter: all of them

Returns#

{ Zone }: map zones, with id, name, data, bucket and fromMap = true

Example#

for _, classroom in map.zones({ type = "classroom" }) do
	classroom.onEnter = function(zone, player)
		player:setBucket(zone.data.bucket, zone)
	end
end

Notes#

  • Players already in the zone are announced on the next tick, with the reason zone_added.
  • Set onEnter and onExit directly on the zone. For inside, call zone:whileInside.
  • A map zone cannot be removed by a script.

See also#

Namespace: PLAYER

Namespace: ENTITY

Namespace: ZONE

Namespace: TIME

Namespace: SCRIPT

Namespace: EVENT

Namespace: CLIENT

Namespace: CLIENT EVENT

Namespace: UNIFORM

Namespace: WAND

Namespace: LOOK

Namespace: CONTROL

Namespace: GAIT

Namespace: VOICE

Namespace: ATELIER

Namespace: TOOL