Client
Zones need no zone resource. The player's position is checked every 250 ms, and inside runs every frame while the player is in the zone. Zones are removed when the resource that added them stops.
AddZone
Parameters
datatabletype—box,sphere, orpolycoordsvector3— centre, forboxandspheresizevector3— forbox. Defaults tovec3(2, 2, 2).rotationnumber— heading in degrees, forboxradiusnumber— forsphere. Defaults to2.0.pointsvector3[]— at least three, forpolythicknessnumber— height of apoly, centred on the points' average height. Defaults to4.0.minZandmaxZoverride it.idstring— optional. Reusing an id replaces that zone.onEnter,onExit,insidefunction(zone)—zoneis{ id, name, type }
Returns
string|nil — the zone id, or nil when the data is incomplete
Example
local zone = Bridge.AddZone({
type = 'box',
coords = vec3(441.0, -981.0, 30.7),
size = vec3(4.0, 4.0, 3.0),
rotation = 90.0,
onEnter = function() Bridge.ShowText('[E] Duty') end,
onExit = function() Bridge.HideText() end,
})RemoveZone
Runs onExit first when the player is inside.
Parameters
idstring
Returns
boolean
Example
Bridge.RemoveZone(zone)IsInZone
Parameters
idstringcoordsvector3— optional. Defaults to the local player.
Returns
boolean
Example
if Bridge.IsInZone(zone) then
print('inside')
end