Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local userinput = game:GetService("UserInputService")
- local keydown = false
- local runanimation = Instance.new("Animation")
- runanimation.AnimationId = "rbxassetid://youranimationidhere"
- runanimation = player.Character.Humanoid:LoadAnimation(runanimation)
- userinput.InputBegan:Connect(function(input)
- if input.KeyCode == Enum.KeyCode.LeftShift then
- keydown = true
- end
- end)
- userinput.InputEnded:Connect(function(input)
- if input.KeyCode == Enum.KeyCode.LeftShift then
- keydown = true
- end
- end)
- while true do
- wait(0.1)
- if keydown == true then
- runanimation:Play()
- else
- runanimation:Stop()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement