-- a localscript placed in `StarterCharacterScripts`
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
humanoid.Running:Connect(function(speed)
if speed > 16 then
-- play run
elseif speed > 0 then
-- play walk
else
-- stop both animations
-- play idle
end
end)
make sure you not playing animations that are already playing