Animation scripting

I am coding an emote system, and when a event is fired I want an animation to play, however it will never stop playing, and loops. I thought of just changing the animation priority, but do not know how to through scripting. So how can I script animation priority, or is that not even the solution?

AnimationTrack.Looped = false

but I would like it to play until the player moves, and it stops

repeat task.wait() until humanoid:MoveDirection.Magnitude  > 0
AnimationTrack.Looped = false