πŸ”₯All scripts on our website are 50% off!πŸ”₯
Logo

Target

QB-Target

Config.useTarget = true

function target(element, event, isMission, task)
    local zOffset = 1.0
    local entityCoords = GetEntityCoords(element)
    local minZ = entityCoords.z - zOffset
    local maxZ = entityCoords.z + zOffset
    if isMission then
    else
        exports["qb-target"]:AddTargetEntity(
            element,
            {
                options = {
                    {
                        type = "client",
                        event = "bit-advancedtasks:targetMain",
                        icon = "fa-solid fa-scythe",
                        label = "Interact",
                        args = {
                            task = task
                        }
                    }
                },
                distance = 2.5
            }
        )
    end
end

OX-Target

Config.useTarget = true

function target(element, event, isMission, task)
    local zOffset = 1.0
    local entityCoords = GetEntityCoords(element)
    local minZ = entityCoords.z - zOffset
    local maxZ = entityCoords.z + zOffset
    if isMission then
    else
        exports.ox_target:addLocalEntity(
            element,
            {
                {
                    name = "bit-advancedtasks:targetMain",
                    icon = "fa-solid fa-scythe",
                    label = "Interact",
                    event = "bit-advancedtasks:targetMain",
                    distance = 2.5,
                    args = {
                        task = task
                    }
                }
            }
        )
    end
end

You can use any target system by adapting these functions to match your target system's API.