Skip to content

GetNearestGate

The gate nearest a point, within a radius.

A gate is a big thing: the radius is tens of metres, not the couple a door needs (60 by default, the same as /gate).

GetNearestGate(x, y, z [, radius])
Parameter Type
x number metres
y number metres
z number metres
radius number metres (default 60) (optional)

string - the gate’s key, or nil when none lies within the radius

local key = GetNearestGate(GetPlayerPos(pid))
if key then ToggleGate(key) end

GetGates · ToggleGate · the Gates group of the index