> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaksam-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get door ID from entity

> Resolve a door ID from its entity handle.

```lua Export theme={null}
exports["doors_creator"]:getDoorIdFromEntity(entity)
```

### Parameters

| Name     | Data Type | Description                               |
| -------- | --------- | ----------------------------------------- |
| `entity` | integer   | The entity handle to get the door ID from |

### Returns

| Data Type | Description                           |
| --------- | ------------------------------------- |
| integer   | The door ID if found, `nil` otherwise |

## Example

```lua theme={null}
-- This example shows how to add a target option to check door IDs using ox_target
-- Note: This is just an example, you'll need to adapt it to your needs and target system
Citizen.CreateThread(function()
    exports.ox_target:addGlobalObject({
        {
            name = 'check_door_id',
            icon = 'fas fa-door-open',
            label = 'Check Door ID',
            onSelect = function(data)
                local doorId = exports["doors_creator"]:getDoorIdFromEntity(data.entity)

                if doorId then
                    print("Found door with ID: " .. doorId)
                end
            end
        }
    })
end)
```


## Related topics

- [Client](/doors-creator/client/index.md)
- [Get door ID data](/doors-creator/server/get-door-id-data.md)
- [Get closest door](/doors-creator/client/get-closest-door.md)
- [On entity spawn](/missions-creator/client/on-entity-spawn.md)
- [Get building ID data](/doors-creator/server/get-building-id-data.md)
