Citizen.CreateThread(function()
while true do
local ped = PlayerPedId()
local id = PlayerId()
local weapon = GetSelectedPedWeapon(ped)
if (GetWeaponDamageType(weapon) ~= 2) then
SetPlayerLockon(id, false)
else
SetPlayerLockon(id, true)
end
Wait(10)
end
end)