local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local SPRINT_SPEED = 25.3 local NORMAL_ANIM_ID = "rbxassetid://102724925865450" local LOW_HEALTH_ANIM_ID = "rbxassetid://92131986088134" local HEALTH_THRESHOLD = 49 local function setupSprint(char) local humanoid = char:WaitForChild("Humanoid") local animator = humanoid:WaitForChild("Animator") local oldSprint = char:FindFirstChild("Sprint") if oldSprint then oldSprint:Destroy() print("Removed old Sprint script from", char.Name) end local normalAnim = Instance.new("Animation") normalAnim.AnimationId = NORMAL_ANIM_ID local normalTrack = animator:LoadAnimation(normalAnim) normalTrack.Looped = true local lowAnim = Instance.new("Animation") lowAnim.AnimationId = LOW_HEALTH_ANIM_ID local lowTrack = animator:LoadAnimation(lowAnim) lowTrack.Looped = true local sprinting = false local lowHealthMode = false local normalSpeed = humanoid.WalkSpeed local function updateAnimation() if sprinting then if humanoid.Health < HEALTH_THRESHOLD then if not lowHealthMode then lowHealthMode = true normalTrack:Stop() lowTrack:Play() end else if lowHealthMode then lowHealthMode = false lowTrack:Stop() normalTrack:Play() end end end end local function startSprint() if not sprinting then sprinting = true humanoid.WalkSpeed = SPRINT_SPEED updateAnimation() end end local function stopSprint() if sprinting then sprinting = false humanoid.WalkSpeed = normalSpeed normalTrack:Stop() lowTrack:Stop() end end UserInputService.InputBegan:Connect(function(input, processed) if not processed and input.KeyCode == Enum.KeyCode.LeftShift then startSprint() end end) UserInputService.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode.LeftShift then stopSprint() end end) humanoid.HealthChanged:Connect(function() updateAnimation() end) RunService.RenderStepped:Connect(function() if sprinting then if humanoid.Health < HEALTH_THRESHOLD then if not lowTrack.IsPlaying then lowTrack:Play() end else if not normalTrack.IsPlaying then normalTrack:Play() end end end end) end if player.Character then setupSprint(player.Character) end player.CharacterAdded:Connect(function(char) setupSprint(char) end)