GetClosestDoor
lua
A door counts only when the player is close enough to see its lock icon. Furniture doors are not included. Use GetClosestFurnitureDoor for those, or IsNearLockableDoor for both.
Return Value
A table with the door data, or nil if no door is close:
- id:
numberThe door ID - propertyId:
numberThe property the door belongs to - state:
number0unlocked,1locked - distance:
numberThe distance from the player - coords:
vector3The door coordinates - maxDistance:
numberThe distance at which the door can be used
Example
lua