Caldona

SprintScript

Mar 31st, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. local mouse = game.Players.LocalPlayer:GetMouse()
  2. local running = false
  3.  
  4. function getTool()
  5. for _, kid in ipairs(script.Parent:GetChildren()) do
  6. if kid.className == "Tool" then return kid end
  7. end
  8. return nil
  9. end
  10.  
  11.  
  12. mouse.KeyDown:connect(function (key) -- Run function
  13. key = string.lower(key)
  14. if string.byte(key) == 48 then
  15. running = true
  16. local keyConnection = mouse.KeyUp:connect(function (key)
  17. if string.byte(key) == 48 then
  18. running = false
  19. end
  20. end)
  21. for i = 1,5 do
  22. game.Workspace.CurrentCamera.FieldOfView = (70+(i*2))
  23. wait()
  24. end
  25. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 25
  26. repeat wait () until running == false
  27. keyConnection:disconnect()
  28. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
  29. for i = 1,5 do
  30. game.Workspace.CurrentCamera.FieldOfView = (80-(i*2))
  31. wait()
  32. end
  33. end
  34. end)
Add Comment
Please, Sign In to add comment