So basically Im trying to make a sprinting animation but if you're standing still and hold shift the animation plays even though you're not moving any help please?
uis = game:GetService("UserInputService") plr = game.Players.LocalPlayer character = game.Workspace:WaitForChild(plr.name) Character = plr.Character uis.InputBegan:connect(function(input) if input.KeyCode == Enum.KeyCode.LeftShift then character.Humanoid.WalkSpeed = 30 local Anim = Instance.new('Animation') Anim.AnimationId = 'rbxassetid://3726121052' PlayAnim = Character.Humanoid:LoadAnimation(Anim) PlayAnim:Play() end if character.Humanoid.WalkSpeed == 0 then return else end end) uis.InputEnded:connect(function(input) if input.KeyCode == Enum.KeyCode.LeftShift then PlayAnim:Stop() character.Humanoid.WalkSpeed = 16 end end)