Simple RTS AI

What im trying to do is a simple pawn with AI that moves from A to B, but if an enemy AI gets close it will attack it. Like a MOBA minon for example, my problem is that idk how to make it move again when it kills the other pawn or to start attacking another Pawn if more than 1 is in attack range. Thanks in adventage for your help and
I apologize of my bad english.