Noverwyn Documentation
API set:
148

‹ All natives

Namespace: ZONE API set: server Language: Luau Improve

zones.sphere

zones.sphere(def: table): Zone

Creates a sphere-shaped zone.

Field Type Role
center Position centre
radius number radius in metres
name string name, shown in the console
onEnter (zone, player, reason) -> () someone enters
onExit (zone, player, reason) -> () someone leaves
inside (zone, player) -> () called regularly for each member
insideEvery number seconds between two calls to inside (0.25 by default)
exitMargin number metres to go past in order to leave, from 0 to 5 (0.25 by default)
priority number overlapping zones: the highest wins
who string "players" (default), "entities" or "all"
bucket number bucket set on entry and given back on exit, without any other code
holes { table } shapes removed from the zone
data table free fields, read through zone.data
debug boolean thick outline, for debugging

Parameters#

  • def (table): fields below

Example#

zones.sphere({
	name = "Fountain",
	center = { 0, 30, 0 },
	radius = 4,
	onEnter = function(_, player)
		player:emit("sound", "water")
	end,
})

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