NPC to play an animation when hit

I am trying to get an NPC to play an animation when the player character clicks the left mouse button. I created a boolean variable to be set to True when the player character hits the component once and from there on out the NPC should play an animation whenever the left button is clicked but it isn’t. If anyone could help me figure this out, would be much appreciated.