Advertisement
Guest User

Untitled

a guest
May 27th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. ArtificialHB = Instance.new("BindableEvent", script)
  2. ArtificialHB.Name = "ArtificialHB"
  3.  
  4. script:WaitForChild("ArtificialHB")
  5.  
  6. frame = Frame_Speed
  7. tf = 0
  8. allowframeloss = false
  9. tossremainder = false
  10. lastframe = tick()
  11. script.ArtificialHB:Fire()
  12.  
  13. game:GetService("RunService").Heartbeat:connect(function(s, p)
  14. tf = tf + s
  15. if tf >= frame then
  16. if allowframeloss then
  17. script.ArtificialHB:Fire()
  18. lastframe = tick()
  19. else
  20. for i = 1, math.floor(tf / frame) do
  21. script.ArtificialHB:Fire()
  22. end
  23. lastframe = tick()
  24. end
  25. if tossremainder then
  26. tf = 0
  27. else
  28. tf = tf - frame * math.floor(tf / frame)
  29. end
  30. end
  31. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement