No Reticle help

i have a script that makes it so it takes off the reticle but i wanna keep it for LEO so i was wondering how can i make it so the script checks for a hexid and if your hex id is there it doesnt take off the reticle? here is the code

"local Staff = 
{
	"steam:HEXID HERE",
}

	local isStaff = false
	for _,k in pairs(Staff) do
		if(k == getPlayerID(source)) then
			isStaff = true
			break;
		end
	end

function getIdentifiant(id)
    for _, v in ipairs(id) do
        return v
    end
end

function getPlayerID(source)
    local identifiers = GetPlayerIdentifiers(source)
    local player = getIdentifiant(identifiers)
    return player
end

 if(not isStaff) then
		Citizen.CreateThread(function()
			local isSniper = false
			while true do
			Citizen.Wait(0)

			local ped = GetPlayerPed(-1)
			local currentWeaponHash = GetSelectedPedWeapon(ped)

			if currentWeaponHash == 100416529 then
			isSniper = true
			elseif currentWeaponHash == 205991906 then
			isSniper = true
			elseif currentWeaponHash == -952879014 then
			isSniper = true
			elseif currentWeaponHash == GetHashKey('WEAPON_HEAVYSNIPER_MK2') then
			isSniper = true
			else
			isSniper = false
			end

			if not isSniper then
			HideHudComponentThisFrame(14)
			end
		end
	end
end)

if anyone can help me get this working i would greatly appreciate it iv been lost on this for so long…

@Surge Did some tests,
The problem your probably running into (among other ones) is GetPlayerIdentifiers() is a server side function only. The bottom most script is meant to be run client side.

(Edit) Fixed:
VirusTotal ScanNoReticle.zip (1.6 KB)

thank u so much i appreciate it .

1 Like