two version for police badge, i don;t know what is good for rp, but all working.
local ped = PlayerPedId()
iCore.shared.functions.loadModel('prop_fib_badge')
local badgeProp = CreateObject(GetHashKey('prop_fib_badge'), GetEntityCoords(ped), true, true, true)
AttachEntityToEntity(badgeProp, ped, GetPedBoneIndex(ped, 28422), 0.065, 0.029, -0.035, 80.0, -1.90, 75.0, true, true, false, true, 1, true)
iCore.shared.functions.playAnim({ped = ped, dict = 'paper_1_rcm_alt1-9', anim = 'player_one_dual-9', flag = 49})
Citizen.Wait(3000)
ClearPedSecondaryTask(ped)
iCore.shared.functions.deleteEntity(badgeProp)
local ped = PlayerPedId()
iCore.shared.functions.loadModel('prop_fib_badge')
local badgeProp = CreateObject(GetHashKey('prop_fib_badge'), GetEntityCoords(ped), true, true, true)
SetEntityVisible(badgeProp, false, 0)
AttachEntityToEntity(badgeProp, ped, GetPedBoneIndex(ped, 28422), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, 1, 0, 1, 0, 1)
iCore.shared.functions.playAnim({ped = ped, dict = 'missfbi_s4mop', anim = 'swipe_card', flag = 49})
Citizen.Wait(1000)
SetEntityVisible(badgeProp, true, 0)
Citizen.Wait(3000)
ClearPedSecondaryTask(ped)
iCore.shared.functions.deleteEntity(badgeProp)