Advertisement
BumpyPlayz

Shift To Sprint Script [Lua]

Oct 29th, 2019
6,919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.86 KB | None | 0 0
  1. local debounce = true
  2.  
  3. game:GetService("UserInputService").InputBegan:Connect(function(input, gamepro)
  4.     if input.KeyCode == Enum.KeyCode.LeftShift then
  5.         if debounce == true then
  6.             debounce = false
  7.             for i = 1,16 do
  8.                 wait()
  9.                 game.Workspace.Camera.FieldOfView = game.Workspace.Camera.FieldOfView + 1.6
  10.                 game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed + 1
  11.             end
  12.             debounce = true
  13.         elseif debounce == false then
  14.             repeat
  15.                 wait()
  16.             until debounce == true
  17.             debounce = false
  18.             for i = 1,16 do
  19.                 wait()
  20.                 game.Workspace.Camera.FieldOfView = game.Workspace.Camera.FieldOfView + 1.6
  21.                 game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed + 1
  22.             end
  23.             debounce = true
  24.         end
  25.     end
  26. end)
  27.  
  28. game:GetService("UserInputService").InputEnded:Connect(function(input, gamepro)
  29.     if input.KeyCode == Enum.KeyCode.LeftShift then
  30.         if debounce == true then
  31.             debounce = false
  32.             for i = 1,16 do
  33.                 wait()
  34.                 game.Workspace.Camera.FieldOfView = game.Workspace.Camera.FieldOfView - 1.6
  35.                 game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed - 1
  36.             end
  37.             debounce = true
  38.         elseif debounce == false then
  39.             repeat
  40.                 wait()
  41.             until debounce == true
  42.             debounce = false
  43.             for i = 1,16 do
  44.                 wait()
  45.                 game.Workspace.Camera.FieldOfView = game.Workspace.Camera.FieldOfView - 1.6
  46.                 game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed - 1
  47.             end
  48.             debounce = true
  49.         end
  50.     end
  51. end)
  52.  
  53. game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Died:Connect(function()
  54.     script.Disabled = true
  55.     game.Workspace.Camera.FieldOfView = 70
  56. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement