Play run animation when player is moving

Hello. I wrote a run script that works when you hold shift and therefore I want the run animation to play only when the player is holding shift and moving.

I tried some methods, such as checking MoveDirection.Magnitude inside a Hum:GetPropertyChangedSignal(“MoveDirection”), or something like that, function but the animation wouldn’t play in some specific scenarios such as when the player doesn’t move their mouse when switching between running and walking. What can I do in this case? Is there any better alternative?

Some people may say that the running function is the solution, but i don’t like this, because, it only checks if the player is walking/running, so if you wanna make a idle, you can’t do with running function. But idk if you wanna try it, feel free to search.