Animation play help

So i made these two animations

Animation A:

Animation B:

And the animation A is playing by this script:
image
image

But I want to make, when the player touch a part, the animation A stops playing, and then the animation B starts playing. How can I make that (And yes, I know how to make a touch event)

EDIT: The animation is playing in a NPC

I think you can use the AnimationTrack:Stop() method to stop the animation once a part is touched. Then you can just call :Play() on the other animation.

You need to create variable for AnimationTrack of A, and inside of the script check what part do you touch. If touch required part, then Track_A:Stop() .