Skip to content

AddTargetBone

Mojito-Fivem edited this page May 6, 2021 · 5 revisions

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 -- "all" will represet all jobs
    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",
	    },
	    {
		event = "unlock",
		icon = "fas fa-door-open",
		label = "Unlock Door",
	    },
	},
	job = {"police", "ambulance", "mechanic"},
	distance = 1.5
    })
end)

Clone this wiki locally