Advertisement
boboh

Untitled

Mar 28th, 2020
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. if bhopapi then
  2. warn("Bhop api is already open.")
  3. else
  4. print("Bhop api is back :partying_face: :tada:")
  5. local setconstant = debug.setconstant or setconstant
  6. local getconstants = debug.getconstants or getconstants
  7. local getupvalues = debug.getupvalues or getupvalues
  8. local setupvalues = debug.setupvalues or setupvalues
  9. local getinfo = debug.getinfo or getinfo
  10. local pcall = pcall
  11. local type = type
  12. local pairs = pairs
  13. local getgc = debug.getgc or getgc or get_gc_objects
  14. local a = is_protected_closure or function()
  15. return false
  16. end
  17. local b = false
  18. local c
  19. local d
  20. local e
  21. local f
  22. for g, h in pairs(getgc()) do
  23. if type(h) == "function" and not a(h) then
  24. pcall(
  25. function()
  26. if not b and getinfo(h)["source"]:find("Movement") then
  27. for i, j in pairs(getconstants(h)) do
  28. if j == 2.7 and c == nil then
  29. c = {[1] = h, [2] = i, [3] = j}
  30. elseif j == 18 and d == nil then
  31. d = {[1] = h, [2] = i, [3] = j}
  32. elseif j == 90 and f == nil then
  33. f = {[1] = h, [2] = i, [3] = j}
  34. end
  35. end
  36. for i, j in pairs(getupvalues(h)) do
  37. if (j == -50 or j == -100) and e == nil then
  38. e = {[1] = h, [2] = i, [3] = j}
  39. end
  40. end
  41. if c ~= nil and d ~= nil and f ~= nil and e ~= nil then
  42. b = true
  43. end
  44. end
  45. end
  46. )
  47. end
  48. end
  49. getgenv().setgains = function(k)
  50. setconstant(c[1], c[2], c[3] * (k or 1))
  51. end
  52. getgenv().setwalkspeed = function(l)
  53. setconstant(d[1], d[2], l or d[3])
  54. end
  55. getgenv().setfriction = function(k)
  56. setconstant(f[1], f[2], f[3] * (k or 1))
  57. end
  58. getgenv().setgravity = function(k)
  59. setupvalue(e[1], e[2], e[3] * (k or 1))
  60. end
  61. end
  62. getgenv().bhopapi = true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement