Third Person Enemy AI Help

Hi I'm making a third person game (Based off of the Lerpz tutorial). And I've created an enemy and now I just need a script. I want my enemy to stay in one spot when the player is out of range. When the player comes in range I want it to run towards the player and stop when it gets next to the player. Then I want it to start slashing at the player with his sword. The Lerpz tutorial script won't work for what I want because I don't want the enemy to run past the player.

Try some of these AI tagged answers or just Google "Unity3d Enemy AI" also try the FPS tutorial