How would I go about making a loop that detects movement on server-sided script?

So currently, I have a keyframe signal that when triggered will allow the player to cancel their animation early. I was wondering how I would make a loop on the serverscript that detects for any player input (possibly MoveDirection)?

I believe you could detect if someone is moving using the humanoid.Running function.

Is there any particular reason it has to be on the server?
The player (and as a result any exploiter) has full absolute control over all of their own animations and movement anyways, so I would personally just, on the client, use MoveDirection or humanoidstate changed stuff, or even just key inputs if you want to do it without much trouble

Sorry for the late reply, it’s because the animations are handled/played on the server.

My bad everyone, I overestimated the problem it was really easy. Using MoveDirection was the way to go.