Finding out if an NPC was killed by a headshot

I’ve no idea how to go about this. I know that the hitgroup for a headshot is 1 , however I don’t know how to find out that the ‘killing shot’ was a headshot.
I’m thinking something to do with OnNpcKilled & Player:LastHitGroup( )
Any help would be fantastic!