Skip to content

CreateSphereZone

A ball-shaped zone around a point - a target hung in the air, or the space around a prop.

A player is inside when their position of record is within radius of the centre, like any zone; as a target (SetZoneHittable) it catches what flies or swings into the ball.

CreateSphereZone(x, y, z, radius)
Parameter Type
x number the centre, metres
y number metres
z number metres
radius number metres

number - the zone’s id; nil when none is free

local apple = CreateSphereZone(1290, 1100, 28.1, 0.08) -- an apple on a post: hit it from twenty paces
SetZoneHittable(apple, true)

SetZoneHittable · AttachZoneToEntity · CreateZone · the Zones group of the index