Advertisement
XxxLloyd061302xxX

Arrest Script

May 22nd, 2018
17,161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. local prisons = game.Workspace.Prison:GetChildren()
  2.  
  3. script.Parent.Equipped:connect(function(mouse)
  4. mouse.Button1Down:connect(function()
  5. if mouse then
  6. if (script.Parent.Parent.Head.Position - mouse.Target.Parent.Parent.Head.Position).magnitude <= 10 then -- Change "10" if you want to. This is the range of the arrest tool. The higher the number the longer the range you can arrest the player
  7. if mouse.Target.Parent:isA("Accessory") then
  8. local char = mouse.Target.Parent.Parent
  9. char.HumanoidRootPart.CFrame = prisons[math.random(1,#prisons)].CFrame + Vector3.new(0,3,0) -- Randomly Puts the Prisoner to the Cell
  10. end
  11. end
  12. if mouse.Target:isA("Part") then
  13. if mouse.Target.Parent.Humanoid then
  14. local char = mouse.Target.Parent
  15. char.HumanoidRootPart.CFrame = prisons[math.random(1,#prisons)].CFrame + Vector3.new(0,3,0) -- Same as this
  16. end
  17. end
  18. end
  19. end)
  20. end)
  21.  
  22. --If you want to test it this in Roblox Studio, Change the LocalScript to Script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement