-- Any client.lua
-- Note: Requires "lua54 'yes'" in your fxmanifest.lua
local Ignored = { [`GROUP_UNARMED`] = true, [`GROUP_THROWN`] = true, [`GROUP_STUNGUN`] = true }
local Bones = { [31086] = "SKEL_Head", [12844] = "IK_Head", [35731] = "RB_Neck_1", [39317] = "SKEL_Neck_1", [25260] = "FB_L_Eye_000", [27474] = "FB_R_Eye_000" }
AddEventHandler("entityDamaged", function(Victim, Attacker, Weapon)
local Ped = PlayerPedId()
if (Victim == Ped) or not IsPedAPlayer(Victim) then
local _, Index = GetPedLastDamageBone(Victim)
if Bones[Index] then
local Group = GetWeapontypeGroup(Weapon)
if not Ignored[Group] then
ApplyDamageToPed(Victim, GetPedMaxHealth(Victim))
end
end
end
end)