Advertisement
jikill24

emergency response script

Jul 4th, 2022
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 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. game:GetService(“ReplicatedStorage”).FE.Handcuffs:InvokeServer(unpack(args))
  22. end
  23. local function GetWantedPlayers()
  24. local wanted = {}
  25. for _, a in pairs(game.Players:GetPlayers()) do
  26. if a:FindFirstChild(“Is_Wanted”) then
  27. table.insert(wanted, a)
  28. end
  29. end
  30. return wanted
  31. end
  32. if #GetWantedPlayers() > 0 then
  33. if plr.Team.Name ~= “Police” then
  34. local args = {
  35. [1] = BrickColor.new(102),
  36. [2] = tostring(math.random(1000, 9999))
  37. }
  38. game:GetService(“ReplicatedStorage”).FE.TeamChange:FireServer(unpack(args))
  39. wait(6)
  40. end
  41. if plr.Team.Name == “Police” then
  42. for i, v in pairs(GetWantedPlayers()) do
  43. if v.Character.PrimaryPart then
  44. ArrestPlayer(v)
  45. end
  46. end
  47. end
  48. end
  49. print(“finished”)
  50. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement