GetNearestDoor

From Onset Developer Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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