> ## 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.

# Tür-ID aus Entität abrufen

> Ermittelt eine Tür-ID anhand ihres Entitäts-Handles.

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

### Parameter

| Name     | Datentyp | Beschreibung                                                  |
| -------- | -------- | ------------------------------------------------------------- |
| `entity` | integer  | Das Entitäts-Handle, aus dem die Tür-ID ermittelt werden soll |

### Rückgabe

| Datentyp | Beschreibung                            |
| -------- | --------------------------------------- |
| integer  | Die Tür-ID, falls gefunden, sonst `nil` |

## Beispiel

```lua theme={null}
-- Dieses Beispiel zeigt, wie man eine Target-Option zum Prüfen von Tür-IDs mit ox_target hinzufügt
-- Hinweis: Dies ist nur ein Beispiel, du musst es an deine Bedürfnisse und dein Target-System anpassen
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](/de/doors-creator/client/index.md)
- [Tür-ID-Daten abrufen](/de/doors-creator/server/get-door-id-data.md)
- [Nächste Tür abrufen](/de/doors-creator/client/get-closest-door.md)
- [Server](/de/doors-creator/server/index.md)
- [Entität gespawnt](/de/missions-creator/client/on-entity-spawn.md)
