AddTargetBone - LiamDormon/bt-target GitHub Wiki

Description

Makes a specific vehicle bone interactive.

Format

AddTargetBone(bones: table, parameters: table)

bones= {
   Bone Labels: string
}

parameters= {
    options: table {event: string, icon: string, label: string, job: string[]}
    distance: int -- distance between player and the model
}

Code Example

Citizen.CreateThread(function()
    local bones = {
        "door_dside_f",
        "door_dside_r",
        "door_pside_f",
        "door_pside_r"
    }
    AddTargetBone(bones, {
	options = {
	    {
		event = "door",
		icon = "fas fa-door-open",
		label = "Toggle Door",
                job = {"all"}
	    },
	    {
		event = "unlock",
		icon = "fas fa-door-open",
		label = "Unlock Door",
                job = {"all"},
	    },
	},
	distance = 1.5
    })
end)