TwoSide3Point0

asfdcawsfcwas

Jul 14th, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. local inputService = game:GetService("UserInputService")
  2. local plr = game.Players.LocalPlayer
  3. local char = plr.Character or plr.CharacterAdded:wait()
  4.  
  5. local sprinting = false
  6.  
  7. inputService.InputBegan:Connect(function (key)
  8. if key.KeyCode == Enum.KeyCode.LeftShift or key.KeyCode == Enum.KeyCode.RightShift then
  9. running = true
  10. if char.Humanoid then
  11. char.Humanoid.WalkSpeed = 180 --This is how fast the player will now go
  12. end
  13. end
  14. end)
  15.  
  16. inputService.InputEnded:Connect(function (key)
  17. if key.KeyCode == Enum.KeyCode.LeftShift or key.KeyCode == Enum.KeyCode.RightShift then
  18. running = false
  19. if char.Humanoid then
  20. char.Humanoid.WalkSpeed = 16 --Player's speed while not sprinting
  21. end
  22. end
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment