Integrations (Optional)
ox_target
local function startTargeting()
if state.isDisabled() or state.isActive() or IsNuiFocused() or IsPauseMenuActive() then return end
state.setActive(true)
local flag = 511
local hit, entityHit, endCoords, distance, lastEntity, entityType, entityModel, hasTick, hasTarget, zonesChanged
local zones = {}
while state.isActive() do
local progressActive = exports["mday_lib"]:progressActive()
if not state.isNuiFocused() and lib.progressActive() or progressActive then
state.setActive(false)
break
end
local playerCoords = GetEntityCoords(cache.ped)
hit, entityHit, endCoords = raycastFromCamera(flag)
distance = #(playerCoords - endCoords)
if entityHit ~= 0 and entityHit ~= lastEntity then
local success, result = pcall(GetEntityType, entityHit)
entityType = success and result or 0
end
---------------------Last updated