local Players = game:GetService("Players") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local function setupAnimations(character) local humanoid = character:WaitForChild("Humanoid") local animate = character:FindFirstChild("Animate") if animate then animate.Disabled = true end local idleAnim = Instance.new("Animation") idleAnim.AnimationId = "rbxassetid://134624270247120" local walkAnim = Instance.new("Animation") walkAnim.AnimationId = "rbxassetid://132377038617766" local runAnim = Instance.new("Animation") runAnim.AnimationId = "rbxassetid://115946474977409" local idleTrack = humanoid:LoadAnimation(idleAnim) local walkTrack = humanoid:LoadAnimation(walkAnim) local runTrack = humanoid:LoadAnimation(runAnim) idleTrack.Priority = Enum.AnimationPriority.Action walkTrack.Priority = Enum.AnimationPriority.Movement runTrack.Priority = Enum.AnimationPriority.Movement idleTrack:Play() RunService.Heartbeat:Connect(function() local speed = humanoid.MoveDirection.Magnitude * humanoid.WalkSpeed for _, track in pairs(humanoid:GetPlayingAnimationTracks()) do local animId = track.Animation.AnimationId if animId ~= idleAnim.AnimationId and animId ~= walkAnim.AnimationId and animId ~= runAnim.AnimationId then if track.Priority == Enum.AnimationPriority.Core or track.Name:lower():find("idle") or animId:lower():find("idle") then track:Stop() end end end if speed > 0.1 then if speed >= 16 then if not runTrack.IsPlaying then idleTrack:Stop() walkTrack:Stop() runTrack:Play() end else if not walkTrack.IsPlaying then idleTrack:Stop() runTrack:Stop() walkTrack:Play() end end else if not idleTrack.IsPlaying then walkTrack:Stop() runTrack:Stop() idleTrack:Play() end end end) end if player.Character then setupAnimations(player.Character) end player.CharacterAdded:Connect(setupAnimations)