I am trying to make my cow walk in my game but only the first part of my script runs. This is what I came up with:
local animation = script.Parent.Animation
local humanoid = script.Parent.Humanoid
local animationTrack = humanoid:LoadAnimation(animation)
local cow = script.Parent
while true do
wait(1)
if script.Parent.HumanoidRootPart.Velocity.Magnitude >= 6 then
animationTrack:Play()
print("playing")
end
end
while true do
wait(1)
if script.Parent.HumanoidRootPart.Velocity.Magnitude <= 5 then
animationTrack:Stop()
print("Stopped")
end
end
What I mean by only the first part is if I switch the second while true script to the first then it will run. (It only works up to line 13) but says it all runs

2 comments
thanks a lot!
No problem! Glad to help!