Enemy AI Chase and Attack Player

Im making a dungeon crawler with different enemies. I have one that chases the player and that works no problem but I struggle with making an enemy chase the player and then when they get close to attack them. Ive looked at different tutorials but nothing is working. Here is my code to see if I made any issues. Sorry for the small screen shot Im new and can only do one.