I couldn't make only "police" jobs can toggle this command with if xPlayer.job.name == "police" then
this code but it didn't worked as I planed
local xPlayers = ESX.GetPlayers()
RegisterNetEvent("pepperspray:Togglepepperspray")
AddEventHandler("pepperspray:Togglepepperspray", function()
if not holdingpepperspray then
RequestModel(GetHashKey(peppersprayModel))
while not HasModelLoaded(GetHashKey(peppersprayModel)) do
Citizen.Wait(100)
end
RequestAnimDict(animDict)
while not HasAnimDictLoaded(animDict) do
Citizen.Wait(100)
end
end