Advertisement
TheRealAK47

JBAutoArrest

Dec 20th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. local plr = game:GetService("Players").LocalPlayer
  2. local function RegF(f, t)
  3. if not debug.getupvalues then
  4. return
  5. end
  6. for i,v in pairs(t or getreg()) do
  7. if type(v) == "function" then
  8. local uvs = debug.getupvalues(v)
  9. for i,v in pairs(uvs) do
  10. if type(v) == "function" and islclosure(v) and f(i,v) then
  11. break
  12. end
  13. end
  14. end
  15. end
  16. end
  17. for i,v in pairs(getreg()) do
  18. if jbFs then break end
  19. if type(v) == "function" then
  20. for i,v in pairs(debug.getupvalues(v)) do
  21. if type(v) == "table" and rawget(v, "FireServer") then
  22. getgenv().jbFs = v
  23. break
  24. end
  25. end
  26. end
  27. end
  28. getgenv().jbKeys = jbKeys or {}
  29. do
  30. local function FIT(t,vv)
  31. for i,v in pairs(t) do
  32. if v == vv then
  33. return i
  34. end
  35. end
  36. return false
  37. end
  38. RegF(function(i,v)
  39. if jbKeys.Arrest then return true end
  40. local const = debug.getconstants(v)
  41. if FIT(const, "ShouldArrest") and FIT(const, "ShouldPickpocket") then
  42. RegF(function(i,v)
  43. const = debug.getconstants(v)
  44. if FIT(const, "Reloading") and FIT(const, "Handcuffs") then
  45. RegF(function(i,v)
  46. const = debug.getconstants(v)
  47. if FIT(const, "FireServer") then
  48. jbKeys.Arrest = const[FIT(const, "FireServer") + 1]
  49. end
  50. end, {v})
  51. return true
  52. end
  53. end, {v})
  54. return true
  55. end
  56. end)
  57. end
  58. local function GetNearestPlayerFromCriminals()
  59. local hrp = plr.Character:FindFirstChild("HumanoidRootPart")
  60. if not hrp then return nil end
  61. local pos = hrp.Position
  62. local closest = {}
  63. for i,v in pairs(game:GetService"Teams".Criminal:GetPlayers()) do
  64. if v.Character and v.Character:FindFirstChild("HumanoidRootPart") and (#closest == 0 or (v.Character.HumanoidRootPart.Position - pos).magnitude < closest[2]) then
  65. closest[1] = v.Name
  66. closest[2] = (v.Character.HumanoidRootPart.Position - pos).magnitude
  67. end
  68. end
  69. return closest[1]
  70. end
  71. while wait() do
  72. jbFs.FireServer(jbFs, jbKeys.Arrest, GetNearestPlayerFromCriminals())
  73. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement