Crosshair help

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)

I still don’t understand what you’re trying to achieve since in stock gta the reticle appears when aiming and only when aiming

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.