AddVehicleBone

AddVehicleBone

This export does the equivalent of AddTargetBone

Arguments

Argument
Description

identifier

The unique string identifier of this target, in-case you want to remove it later

bones

A single, or table of, bone(s) that you want to apply the target to

options

The options for the target (see Options Formatting)

Usage

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

Example


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

Argument
Description

identifier

The unique string identifier of the target you want to remove

Example

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

Last updated