# AddVehicleBone

## AddVehicleBone

This export does the equivalent of AddTargetBone

### Arguments

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>identifier</td><td>The unique string identifier of this target, in-case you want to remove it later</td><td></td></tr><tr><td>bones</td><td>A single, or table of, bone(s) that you want to apply the target to</td><td></td></tr><tr><td>options</td><td>The options for the target (see <a data-mention href="../options-formatting">options-formatting</a>)</td><td></td></tr></tbody></table>

### Usage

```lua
exports['nyx2_target']:AddVehicleBone(identifier, bones, options)
```

### Example

```lua

exports['nyx2_target']:AddVehicleBone('debug_veh_bone', 'bonnet', {
    {
        title = 'Debug Vehicle Bone (Bonnet)',
        icon = 'fas fa-cube',
        action = function(zone)
            local QBCore = exports['qb-core']:GetCoreObject()
            QBCore.Functions.Notify('This is a bone!', 'success')
        end,
        canInteract = function(zone)
            return true
        end,
        job = nil, -- if nil, all jobs can interact
        gang = nil, -- if nil, all gangs can interact
        citizenid = nil, -- if nil, all players can interact
        item = nil, -- if nil, don't require an item to interact
    }
})

exports['nyx2_target']:AddVehicleBone('debug_veh_bone', 'boot', {
    {
        title = 'Debug Vehicle Bone (Boot)',
        icon = 'fas fa-cube',
        action = function(zone)
            local QBCore = exports['qb-core']:GetCoreObject()
            QBCore.Functions.Notify('This is a bone!', 'success')
        end,
        canInteract = function(zone)
            return true
        end,
        job = nil, -- if nil, all jobs can interact
        gang = nil, -- if nil, all gangs can interact
        citizenid = nil, -- if nil, all players can interact
        item = nil, -- if nil, don't require an item to interact
    }
})
```

## RemoveVehicleBone

This export removes a vehicle bone target that you have created.

### Arguments

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>identifier</td><td>The unique string identifier of the target you want to remove</td><td></td></tr></tbody></table>

### Example

```lua
exports['nyx2_target']:RemoveVehicleBone('debug_veh_bone')
```
