> For the complete documentation index, see [llms.txt](https://mstudio-1.gitbook.io/mstudio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mstudio-1.gitbook.io/mstudio/kz-resources/editor-9/installation/guide.md).

# Guide

## 💭 Installation for ox\_inventory

{% hint style="info" %}
Create items in the inventory
{% endhint %}

Default items: **"../ox\_inventory/data/items.lua"**

```lua
	['scatola'] = {
		label = "Scatola",
		weight = 100,
		stack = false,
		close = true,
		consume = 0,
		client = { export = 'Kz-Box.PlaceScatola' }
	},

	['scatola_documenti'] = {
		label = "Scatola Documenti",
		weight = 120,
		stack = false,
		close = true,
		consume = 0,
		client = { export = 'Kz-Box.PlaceScatola' }
	},

	['scatola_armi'] = {
		label = "Scatola Armi",
		weight = 200,
		stack = false,
		close = true,
		consume = 0,
		client = { export = 'Kz-Box.PlaceScatola' }
	},

	['scatola_munizioni'] = {
		label = "Scatola Munizioni",
		weight = 70,
		stack = false,
		close = true,
		consume = 0,
		client = { export = 'Kz-Box.PlaceScatola' }
	},
```

{% hint style="info" %}
Remove the vehicle trunk inventory
{% endhint %}

File path: "**../ox\_inventory/modules/inventory/client.lua"**

```lua
    --Remove this block
    exports.ox_target:addGlobalVehicle({
        icon = 'fas fa-truck-ramp-box',
        label = locale('open_label', locale('storage')),
        distance = 1.5,
        canInteract = Inventory.CanAccessTrunk,
        onSelect = function(data)
            return Inventory.OpenTrunk(data.entity)
        end
    })
```

***

## 💭 Installation for ox\_target

File path: "**../ox\_target/client/defaults.lua"**

{% hint style="success" %}
Add this block
{% endhint %}

```lua
local function playTrunkAnim(dict, anim)
    lib.requestAnimDict(dict)
    TaskPlayAnim(cache.ped, dict, anim, 8.0, 8.0, -1, 48, 0, false, false, false)
    Wait(1200)
    ClearPedTasks(cache.ped)
end
```

{% hint style="info" %}
Edit this block
{% endhint %}

```lua
local function toggleDoor(vehicle, door)
    if GetVehicleDoorLockStatus(vehicle) ~= 2 then
        if GetVehicleDoorAngleRatio(vehicle, door) > 0.0 then
            if door == 5 then
                playTrunkAnim('anim_heist@hs3f@ig14_open_car_trunk@male@', 'close_trunk')
            end
            SetVehicleDoorShut(vehicle, door, false)
        else
            if door == 5 then
                playTrunkAnim('anim@scripted@hs4f@ig14_open_car_trunk@heeled@', 'open_trunk_rushed')
            end
            SetVehicleDoorOpen(vehicle, door, false, false)
        end
    end
end
```

{% hint style="warning" %}
Replace the "canInteractWithDoor" function with this one
{% endhint %}

```lua
local function canInteractWithDoor(entity, coords, door, useOffset)
    if not GetIsDoorValid(entity, door) or GetVehicleDoorLockStatus(entity) > 1 or IsVehicleDoorDamaged(entity, door) or cache.vehicle then return end

    if useOffset then return true end

    local boneName = bones[door]
    if not boneName then return false end

    local boneId = GetEntityBoneIndexByName(entity, 'door_' .. boneName)

    if boneId ~= -1 then
        return #(coords - GetEntityBonePosition_2(entity, boneId)) < 0.5 or
            #(coords - GetEntityBonePosition_2(entity, GetEntityBoneIndexByName(entity, 'seat_' .. boneName))) < 0.72
    end
end
```
