# Keychain

When using ox\_inventory, the doorlock offers a “keychain” option. This allows you to insert keys and door cards into the item.

{% hint style="danger" %}
**Compatibility** The "keychain" function only works with `ox_inventory`, since it offers a container system per item. Keychain can not be opened when using an inventory other than `ox_inventory`.
{% endhint %}

## Setup

After uploading the items according to the tutorial in *Configurations* section, go to `ox_inventory/modules/items/containers.lua` and insert the following code at the end of the file:

```lua
setContainerProperties('rd_keychain', {
    slots = 10,
    maxWeight = 1000.0,
    whitelist = { 'door_key', 'door_card' }
})
```

You can edit the code for maximum weight or number of slots.

{% hint style="danger" %}
It is important that we still have `return containers` at the end of the file!
{% endhint %}

In the final version, the end of the file should look like this:\
![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-dc27da50c356df96dd6f73a09d907aa112a5162e%2FdoorlockKeychain.png?alt=media)
