How to play a particular animation for AI?

@Erasio I’ve tried it but the attack animation keeps playing, even if the player moves away.