Hi Guys, quick question what will i need to add to this code for the crosshair to only show while aiming. Right now, it shows while having a weapon in hand.
Here’s the code:
local on = true
Citizen.CreateThread(function()
while true do
if on and IsPlayerFreeAiming(PlayerId()) then
HideHudComponentThisFrame(14)
DrawRect(0.5, 0.5, 0.001, 0.001, 255, 255, 255, 255)
end
Citizen.Wait(6)
end
end)
RegisterNetEvent(‘cl:update_c’)
AddEventHandler(‘cl:update_c’, function(bool)
on = bool
end)
RegisterCommand(‘togglecrosshair’, function()
if on then
on = false
elseif not on then
on = true
end
end)