Guest User

hello

a guest
Oct 5th, 2022
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. --Put this in a local script in StarterGUI
  2.  
  3. local UIS = game:GetService("UserInputService")
  4. local DefaultFOV = 70
  5.  
  6. local lastTime = tick()
  7.  
  8. local char = game:GetService("Players").LocalPlayer.Character
  9. local hum = char:WaitForChild("Humanoid")
  10.  
  11. UIS.InputBegan:Connect(function(input,gameprocessed)
  12. if input.KeyCode == Enum.KeyCode.W then
  13. local now = tick()
  14. local difference = (now - lastTime)
  15.  
  16. if difference <= 0.5 then
  17. if hum.WalkSpeed < 11 then
  18. print("running")
  19. hum.WalkSpeed = 18
  20.  
  21. local properties = {FieldOfView = DefaultFOV + 15}
  22. local Info = TweenInfo.new(0.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
  23. local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera,Info,properties)
  24. T:Play()
  25. end
  26. end
  27. lastTime = tick()
  28. end
  29. end)
  30.  
  31. UIS.InputEnded:Connect(function(input,gameprocessed)
  32. if input.KeyCode == Enum.KeyCode.W then
  33.  
  34. print("running")
  35. hum.WalkSpeed = 32
  36.  
  37. local properties = {FieldOfView = DefaultFOV}
  38. local Info = TweenInfo.new(0.5,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0.1)
  39. local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera,Info,properties)
  40. T:Play()
  41.  
  42. end
  43.  
  44. end)
  45.  
  46. hum.Died:Connect(function()
  47. game.Workspace.Camera.FieldOfView = DefaultFOV
  48. hum.WalkSpeed = 16
  49. script.Disabled = true
  50. end)
Advertisement
Add Comment
Please, Sign In to add comment