why one local script on ReplicatedStorage, making character animation look weird and clapping their hands
External Medialocal Characters = workspace.Characters
local Players = Characters.Players
local NPCs = Characters.NPCs
local Animations = {
Sprint = "rbxassetid://119254390264746"
}
function onCharacterAdded(child)
local Humanoid = child:FindFirstChild("Humanoid")
local Animator = Humanoid:FindFirstChild("Animator")
local Sprint = Instance.new("Animation")
Sprint.AnimationId = Animations.Sprint
local SprintTrack = Animator:LoadAnimation(Sprint)
Humanoid.Died:Connect(function()
print(child)
end)
Humanoid.Running:Connect(function(speed)
if speed > 0.1 then
if not SprintTrack.IsPlaying then
SprintTrack:Play()
end
else
if SprintTrack.IsPlaying then
SprintTrack:Stop()
end
end
end)
end
Players.ChildAdded:Connect(onCharacterAdded)
NPCs.ChildAdded:Connect(onCharacterAdded)
for _, characters in pairs(Characters:GetDescendants()) do
if characters:IsA("Model") and characters:FindFirstChild("Humanoid") then
onCharacterAdded(characters)
end
end