I would recommend storing the AnimationTrack in a Variable, because all this will do is Load a new anination everytime something happens, so like this:
local walkAnim = Hum:LoadAnimation(Anim)
-- In Event
if speed > amount then
walkAnim:Play()
else
walkAnim:Stop()
end
If you dont want the Track to loop, there is a property to stop this for the AnimationTrack
local animation = humanoid:LoadAnimation(WalkingAnimation)
humanoid.StateChanged:Connect(function(state,newstate)
if newstate == Enum.HumanoidStateType.Running then
animation:Play()
else
animation:Stop()
end
end)
well i technically didn’t solve this problem , but i kinda changed it to not stand out that much…
like it’s still there but it looks like it isn’t…
so what i did is i made the animation play when the running event fired and made it stop when the npc would stop following the player…
so the problem is still there since it never stops when the npc actually stops… it stops when the npc loses the player and i assume he’s going to be idle…