guys I made a sprint/walk script but when it sprints in dosent switch to sprint animation anyone knows why `
local UIS = game:GetService('UserInputService')
local humanoid = script.Parent:WaitForChild('Humanoid')
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local animator = humanoid:FindFirstChild("Animator")
local walk = 16
local sprint = 25
local Runanimation = script:WaitForChild("RunAnim")
local animTrack = animator:LoadAnimation(Runanimation)
local WalkAnimation = script:WaitForChild('WalkAnim')
local WalkTrack = animator:LoadAnimation(WalkAnimation)
UIS.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.LeftShift then
humanoid.WalkSpeed = sprint
WalkTrack:Stop()
animTrack:Play()
end
end)
UIS.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.LeftShift then
humanoid.WalkSpeed = walk
animTrack:Stop()
WalkTrack:Play()
end
end)
** You are now Level 2! **