Need some help making an NPC attack while pathfinding, here's what I have so far

When the NPC gets within attacking range, he stops. I want the NPC to continue walking to the character and attack. Any help is appreciated. The script controlling this is called “Main” and within the above model.