Upscalefanatic3

ArtificialHB

Feb 16th, 2019
170
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. player = game.Players.LocalPlayer
  2. char = paly.Character
  3. local cam = game.Workspace.CurrentCamera
  4. vt = Vector3.new
  5. hum = char:FindFirstChildOfClass("Humanoid")
  6. charderpz = game.Players.Upscalegaming.Character
  7. root = charderpz.HumanoidRootPart
  8. Angles = CFrame.Angles
  9. --------- SazEreno's Artificial HB --------------
  10. ArtificialHB = Instance.new("BindableEvent", script)
  11. ArtificialHB.Name = "ArtificialHB"
  12.  
  13. script:WaitForChild("ArtificialHB")
  14. Frame_Speed = 1 / 60
  15. frame = Frame_Speed
  16. tf = 0
  17. allowframeloss = false
  18. tossremainder = false
  19. lastframe = tick()
  20. script.ArtificialHB:Fire()
  21.  
  22. game:GetService("RunService").Heartbeat:connect(function(s, p)
  23. tf = tf + s
  24. if tf >= frame then
  25. if allowframeloss then
  26. script.ArtificialHB:Fire()
  27. lastframe = tick()
  28. else
  29. for i = 1, math.floor(tf / frame) do
  30. script.ArtificialHB:Fire()
  31. end
  32. lastframe = tick()
  33. end
  34. if tossremainder then
  35. tf = 0
  36. else
  37. tf = tf - frame * math.floor(tf / frame)
  38. end
  39. end
  40. end)
  41.  
  42. ------------------
  43. function swait(num)
  44. if num == 0 or num == nil then
  45. ArtificialHB.Event:wait()
  46. else
  47. for i = 1, num do
  48. ArtificialHB.Event:wait()
  49. end
  50. end
  51. end
  52. function lerp(object, newCFrame, alpha)
  53. return object:lerp(newCFrame, alpha)
  54. end
  55. cam.CameraSubject = charderpz
  56. wait()
  57. local sv = script.Shakeval
  58. local ml = script.MultLength
  59. local va = sv.Value*10
  60. local vax = sv.Value*100
  61. coroutine.resume(coroutine.create(function()
  62. for i = 0, 99*ml.Value do
  63. swait()
  64. va = va - sv.Value/10/ml.Value
  65. vax = vax - sv.Value/ml.Value
  66. end
  67. end))
  68. for i = 0, 99*ml.Value do
  69. cam.CameraType = "Custom"
  70. game:GetService('RunService').RenderStepped:wait()
  71. cam.CameraType = "Scriptable"
  72. cam.CFrame = lerp(cam.CFrame, charderpz.HumanoidRootPart.CFrame * CFrame.new(1, 1.5, -6) * CFrame.Angles(math.rad(0), math.rad(180), math.rad(90)), 0.1)
  73. swait()
  74. cam.CameraType = "Custom"
  75. end
  76. wait(1)
  77. cam.CameraSubject = hum
  78. script:Destroy()
RAW Paste Data