Advertisement
AALTTz

sprint

Jul 20th, 2022
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. local Players = game:service('Players')
  2.  
  3. local Player = Players.LocalPlayer
  4.  
  5.  
  6.  
  7. local userInput = game:service('UserInputService')
  8.  
  9. local runService = game:service('RunService')
  10.  
  11.  
  12.  
  13. repeat wait() until Player.Character
  14.  
  15.  
  16.  
  17. local Character = Player.Character
  18.  
  19. local pHum = Character:WaitForChild('Humanoid')
  20.  
  21. local humRoot = Character:WaitForChild('HumanoidRootPart')
  22.  
  23.  
  24.  
  25. local Multiplier = 0.3
  26.  
  27.  
  28.  
  29. userInput.InputBegan:connect(function(Key)
  30.  
  31. if Key.KeyCode == Enum.KeyCode.LeftBracket then
  32.  
  33. Multiplier = Multiplier + 0.1
  34.  
  35. print(Multiplier)
  36.  
  37. wait(0.2)
  38.  
  39. while userInput:IsKeyDown(Enum.KeyCode.LeftBracket) do
  40.  
  41. wait()
  42.  
  43. Multiplier = Multiplier + 0.1
  44.  
  45. print(Multiplier)
  46.  
  47. end
  48.  
  49. end
  50.  
  51.  
  52.  
  53. if Key.KeyCode == Enum.KeyCode.RightBracket then
  54.  
  55. Multiplier = Multiplier - 0.1
  56.  
  57. print(Multiplier)
  58.  
  59. wait(0.2)
  60.  
  61. while userInput:IsKeyDown(Enum.KeyCode.RightBracket) do
  62.  
  63. wait()
  64.  
  65. Multiplier = Multiplier - 0.1
  66.  
  67. print(Multiplier)
  68.  
  69. end
  70.  
  71. end
  72.  
  73. end)
  74.  
  75.  
  76.  
  77. runService.Stepped:connect(function()
  78.  
  79. if userInput:IsKeyDown(Enum.KeyCode.LeftShift) then
  80.  
  81. humRoot.CFrame = humRoot.CFrame + pHum.MoveDirection * Multiplier
  82.  
  83. end
  84.  
  85. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement