local plr = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local walkSpeed = 10
local sprintSpeed = 32
local speedBuildTime = 0.5 -- seconds to reach full sprint speed
local humanoid = nil
local sprinting = false
-- Find AnimationController and Animation objects under this script
local animController = script:FindFirstChild("SprintAnimController")
local speedBurstAnimObj = nil
local sprintAnimObj = nil
if animController then
speedBurstAnimObj = animController:FindFirstChild("SpeedBurst")
sprintAnimObj = animController:FindFirstChild("Sprint")
end
local speedBurstTrack = nil
local sprintTrack = nil
local function stopAndDestroy(track)
if track then
track:Stop()
track:Destroy()
end
end
local function updateHumanoid()
if plr.Character then
humanoid = plr.Character:FindFirstChild("Humanoid")
if humanoid then
humanoid.WalkSpeed = walkSpeed
-- Clean up previous tracks
stopAndDestroy(speedBurstTrack)
stopAndDestroy(sprintTrack)
speedBurstTrack = nil
sprintTrack = nil
-- Load animations if available
if speedBurstAnimObj then
speedBurstTrack = humanoid:LoadAnimation(speedBurstAnimObj)
end
if sprintAnimObj then
sprintTrack = humanoid:LoadAnimation(sprintAnimObj)
end
end
end
end
** You are now Level 1! **