Here's the script
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
local Animate = Character:WaitForChild("Animate")
local Animation = script.Parent:WaitForChild("Anim")
local Anim = Animation.AnimationId
local Original = Animate.walk.WalkAnim.AnimationId
local Running = script.Parent:WaitForChild("Running")
Running.Changed:Connect(function()
print("Doing Stuff")
if Humanoid.MoveDirection.Magnitude > 0 and Running.Value == true then
Animate.walk.WalkAnim.AnimationId = Animation.AnimationId
print("New Anim")
else
Animate.walk.WalkAnim.AnimationId = Original
print("Old Anim")
end
end)
The problem is that the animations aren't loading correctly, if you want to play the sprint animation, You can't do it while walking, You have to press shift before you start walking. If you want to stop the animation, you have to stop walking.
I've tried multiple scripts to do this.. But the problem isalways the same, The animations have trouble playing.

5 comments
Make use of Humanoid:LoadAnimation() and UserInputService for inputs.
why not write animation:stopped() change the id then animation:play again? u should try that.
If I make it play, It will not stop, will it?
i mean like every time ur gonna change the animation set the default one stop then change id then let new one play
How can I sop the default animation if I don't have the Loaded animation variable?