Hi I need help with this running script Right now it plays when you press shift even if you're standing still how would you make it so it only plays it when you are moving around and stuff?
repeat wait() until game.Players.LocalPlayer player = game.Players.LocalPlayer character = player.Character game.Workspace:WaitForChild(game.Players.LocalPlayer.Name) if not character then character = player.CharacterAdded:wait() end Mouse = player:GetMouse() humanoid = character:WaitForChild("Humanoid") s = humanoid:LoadAnimation(script.Animation) Mouse.KeyDown:connect(function(key) for i, v in pairs(game.Players:GetChildren()) do if Enum.KeyCode.LeftShift then s:Play() humanoid.WalkSpeed = 30 end Mouse.KeyUp:connect(function(key) if Enum.KeyCode.LeftShift then s:Stop() humanoid.WalkSpeed = 16 end end) end end)
I guess the easiest way is while you hold shiFt that it plays animation if the humanoid's move coordinates aren't 0, 0, 0
make a function to check if the torso position is equal and if so just stop the animation. You would need to put a wait command though.