I'm trying to play an animation every time a player is running, in a limited time. I've already tried to use something like this
local humanoid = script.Parent:WaitForChild("Humanoid") local anim = script.Animation local animTrack = humanoid:LoadAnimation(anim) humanoid.Running:Connect(function(speed) if speed > 0 then animTrack:Play() else animTrack:Stop() end end)
in StarterCharacterScripts, and also altered it a bit to use in StarterPlayerScripts, but it didn't work. What's wrong?
Here
local humanoid = script.Parent:WaitForChild("Humanoid") local anim = script.Animation local animTrack = humanoid:LoadAnimation(anim) while true do wait(0.001) humanoid.Running:Connect(function(speed) if speed > 0 then animTrack:Play() else animTrack:Stop() end end end)
its that work?