GetNearestDoor

From Onset Developer Wiki
GetNearestDoor

Type: Function
Context: Client
Introduced: v1.0

Description

Gets the nearest door from the specified XYZ vector created earlier with CreateDoor.

Syntax

GetNearestDoor(x, y, z)

Parameters

  • x
    The X axis
  • y
    The Y axis
  • z
    The Z axis

Return Value

  • the door identifier on success.

Example

local x, y, z = GetPlayerLocation()
local doorId = GetNearestDoor(x, y, z)

if doorId ~= 0 then
    print("No nearby door was found.")
end

See also