try this , and check form NPC reosurce .
?
function playerDamage_text ( attacker, weapon, bodypart, loss)
if ( bodypart == 9 and attacker and attacker ~= source ) then
local Health , Armor = getElementHealth ( source ) , getPedArmor ( source )
setElementHealth ( source , Health - 50 )
outputChatBox ( tostring ( Health )..' ; '.. tostring ( Health - 50 ) )
if ( Armor > 0 ) then
setPedArmor ( source , Armor ( source ) - 50 )
end
end
end
addEventHandler ( "onClientPedDamage", root, playerDamage_text )