Fighting game AI

i need help with enemies walking toward a character when he gets a certain distance and random enemies,then attack the main character then health goes down,
and i need it when i attack the enemie he dies,