Main/resources/[carscripts]/slashtires/bridge/target/ox_target.lua
2025-06-07 08:51:21 +02:00

24 lines
714 B
Lua

local bones = {}
for boneName, _index in pairs(WHEEL_BONES) do
bones[#bones+1] = boneName
end
exports.ox_target:addGlobalVehicle({
{
label = GetLocalization('target_label'),
icon = Config.TargetIcon,
distance = Config.MaxTireInteractionDist,
bones = bones,
canInteract = function(entity)
return TargetCanInteract(entity)
end,
onSelect = function(data)
local tire = exports[CURRENT_RESOURCE]:getClosestVehicleTire(data.entity, data.coords)
if tire.index == nil then
return
end
exports[CURRENT_RESOURCE]:attemptToSlashTire(tire)
end
}
})