# INTERIOR::GET_ROOM_KEY_FROM_ENTITY

- **Hash:** `0x076E46E0EB52AFC6`
- **Namespace:** INTERIOR
- **Runtime name (Lua/JS):** `GetRoomKeyFromEntity`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/INTERIOR/GET_ROOM_KEY_FROM_ENTITY

## Signature

```c
Hash GET_ROOM_KEY_FROM_ENTITY(Entity entity);
```

## Parameters

- `entity` (`Entity`)

## Returns

`Hash`

## Description

Gets the room hash key from the room that the specified entity is in. Each room in every interior has a unique key. Returns 0 if the entity is outside.

## Usage

### Lua

```lua
local retval = GetRoomKeyFromEntity(entity)

-- always available, by hash
local retval = Citizen.InvokeNative(0x076E46E0EB52AFC6, entity, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetRoomKeyFromEntity(entity);

// by hash
const retval = Citizen.invokeNative('0x076E46E0EB52AFC6', entity, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x076E46E0EB52AFC6, entity);
```

*Sources: alloc8or RDR3 NativeDB.*
