Hey guys, how can I say do not AttachEntity while in Car ?
CreateThread(function()
for k, v in pairs(Config.DetectZones) do
local MetalZone = PolyZone:Create(v.zones, {
name = v.label,
debugPoly = Config.DebugPoly
})
MetalZone:onPlayerInOut(function(isPointInside)
if isPointInside then
inZone = 1
QBCore.Functions.TriggerCallback('QBCore:HasItem', function(HasItem)
if HasItem then
AttachEntity(PlayerPedId(), "w_am_digiscanner")
end
end, 'metaldetector')
else
inZone = 0
DetachEntity(ent, 0, 0)
DeleteEntity(ent)
end
end)
end
end