GetNearestDoor

From Onset Developer Wiki
Revision as of 14:04, 1 January 2020 by 28days (talk | contribs) (Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|Gets the nearest door from the specified XYZ vector created earlier with CreateDoor.}} {{FuncSyntax|GetNearestDoor(x, y, z...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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