Advertisement
SmokeDelsin

shift to run

May 10th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 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 = 70
  26. --if game.Players.LocalPlayer--.user:findFirstChild("leaderstats") ~= nil then
  27. --print 'Hello world!'
  28.  
  29. repeat wait () until running == false
  30. keyConnection:disconnect()
  31. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
  32. for i = 1,5 do
  33. game.Workspace.CurrentCamera.FieldOfView = (80-(i*2))
  34. wait()
  35. end
  36. end
  37. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement