Advertisement
PRO_GAMER_ROBLOX

Emergency Response: Liberty County AUTO ARREST [OPEN SOURCE]

Jun 29th, 2021
15,413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. pcall(function()
  2. repeat wait() until game:IsLoaded()
  3. local plr = game.Players.LocalPlayer
  4. local function ArrestPlayer(target)
  5.    local count = 0
  6.    while target.Character.Humanoid.WalkSpeed > 0 and target.Character.Humanoid.Health > 0.1 and target:FindFirstChild("Is_Wanted") and count < 50 do
  7.        count = count + 1
  8. wait(0.1)
  9. plr.Character:SetPrimaryPartCFrame(target.Character.PrimaryPart.CFrame)
  10. local args = {
  11.    [1] = "Handcuff",
  12.    [2] = target
  13. }
  14. game:GetService("ReplicatedStorage").FE.Handcuffs:InvokeServer(unpack(args))
  15. end
  16. wait()
  17. local args = {
  18.    [1] = "Arrest",
  19.    [2] = target
  20. }
  21.  
  22. game:GetService("ReplicatedStorage").FE.Handcuffs:InvokeServer(unpack(args))
  23. end
  24. local function GetWantedPlayers()
  25.    local wanted = {}
  26.    for _, a in pairs(game.Players:GetPlayers()) do
  27.        if a:FindFirstChild("Is_Wanted") then
  28.            table.insert(wanted, a)
  29.        end
  30.    end
  31.    return wanted
  32. end
  33. if #GetWantedPlayers() > 0 then
  34.    if plr.Team.Name ~= "Police" then
  35.        local args = {
  36.            [1] = BrickColor.new(102),
  37.            [2] = tostring(math.random(1000, 9999))
  38.        }
  39.        game:GetService("ReplicatedStorage").FE.TeamChange:FireServer(unpack(args))
  40.        wait(6)
  41.    end
  42.    if plr.Team.Name == "Police" then
  43.        for i, v in pairs(GetWantedPlayers()) do
  44.            if v.Character.PrimaryPart then
  45.                ArrestPlayer(v)
  46.            end
  47.        end
  48.    end
  49. end
  50. print("finished")
  51. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement