so i made this script and when i stop walking and then restart it play walk anim ,not sprint anim
local UserInputService = game:GetService("UserInputService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local sprintAnim = humanoid:LoadAnimation(script:WaitForChild("SprintAnim"))
local isSprinting = false
humanoid.Running:Connect(function(speed)
if speed > 0 then
sprintAnim:AdjustSpeed(1)
else
sprintAnim:Stop()
end
end)
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
if not isSprinting then
isSprinting = true
sprintAnim:Play()
sprintAnim:AdjustSpeed(0)
humanoid.WalkSpeed = 26
humanoid.JumpPower = 50
else
sprintAnim:Stop()
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
isSprinting = false
end
end
end)

2 comments
u need to put a local script in startercharacterscript with a animation in it to test it
https://www.roblox.com/games/5620655698/project-index here u can test the game