Okay so, the animation is set to loop, I'm just trying to get the Animation to stop playing after once the character stops moving. I have the if Anim then Anim:Stop() to stop it from playing upon player join
local Anim humanoid.Running:Connect(function(speed) CurrentAnim = "Walking" if speed > 0 then local Animation = Instance.new('Animation') Animation.AnimationId = WalkAnimID Anim = humanoid:LoadAnimation(Animation) Anim:Play() else if Anim then Anim:Stop() if speed == 0 then Anim:Stop() end CurrentAnim = "" end end end)
Simply call the GetPlayingAnimationTracks method on the humanoid, and set a pointer to what it returns like so:
local Animations = humanoid:GetPlayingAnimationTracks();
Then, go through them one by one:
for Key, Value in next, Animations do --Key is the current animation # you are on & Value is the pointer to the current animation --\\Code//-- end;
Now call the stop method on 'value':
Value:Stop();