How do i make Pathfinding NPC run away and hide from the player when he looks at it?

Maybe this could help?
It hasn’t been marked as solved yet though.