Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game:GetService("Players").LocalPlayer
- local function RegF(f, t)
- if not debug.getupvalues then
- return
- end
- for i,v in pairs(t or getreg()) do
- if type(v) == "function" then
- local uvs = debug.getupvalues(v)
- for i,v in pairs(uvs) do
- if type(v) == "function" and islclosure(v) and f(i,v) then
- break
- end
- end
- end
- end
- end
- for i,v in pairs(getreg()) do
- if jbFs then break end
- if type(v) == "function" then
- for i,v in pairs(debug.getupvalues(v)) do
- if type(v) == "table" and rawget(v, "FireServer") then
- getgenv().jbFs = v
- break
- end
- end
- end
- end
- getgenv().jbKeys = jbKeys or {}
- do
- local function FIT(t,vv)
- for i,v in pairs(t) do
- if v == vv then
- return i
- end
- end
- return false
- end
- RegF(function(i,v)
- if jbKeys.Arrest then return true end
- local const = debug.getconstants(v)
- if FIT(const, "ShouldArrest") and FIT(const, "ShouldPickpocket") then
- RegF(function(i,v)
- const = debug.getconstants(v)
- if FIT(const, "Reloading") and FIT(const, "Handcuffs") then
- RegF(function(i,v)
- const = debug.getconstants(v)
- if FIT(const, "FireServer") then
- jbKeys.Arrest = const[FIT(const, "FireServer") + 1]
- end
- end, {v})
- return true
- end
- end, {v})
- return true
- end
- end)
- end
- local function GetNearestPlayerFromCriminals()
- local hrp = plr.Character:FindFirstChild("HumanoidRootPart")
- if not hrp then return nil end
- local pos = hrp.Position
- local closest = {}
- for i,v in pairs(game:GetService"Teams".Criminal:GetPlayers()) do
- if v.Character and v.Character:FindFirstChild("HumanoidRootPart") and (#closest == 0 or (v.Character.HumanoidRootPart.Position - pos).magnitude < closest[2]) then
- closest[1] = v.Name
- closest[2] = (v.Character.HumanoidRootPart.Position - pos).magnitude
- end
- end
- return closest[1]
- end
- while wait() do
- jbFs.FireServer(jbFs, jbKeys.Arrest, GetNearestPlayerFromCriminals())
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement