if not isfile("auto_arrest.txt") then
writefile("auto_arrest.txt", game:HttpGet("https://rscripts.net/raw/prison-life-or-guard-auto-arrest_1760819423467_jvcLwWcp4l.txt"))
end
local SERVER_HOPPING = true
if not game:IsLoaded() then
repeat task.wait() until game:IsLoaded()
end
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local arrestPlayer = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("ArrestPlayer")
local changeTeamEvent = workspace:WaitForChild("Remote"):WaitForChild("TeamEvent")
local LocalPlayer = Players.LocalPlayer
local LocalCharacter = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local LocalHrp = LocalCharacter:WaitForChild("HumanoidRootPart")
local LocalHumanoid = LocalCharacter:WaitForChild("Humanoid")
if not LocalPlayer.Team then
return
end
function shop()
queue_on_teleport(readfile("auto_arrest.txt"))
while task.wait() do
local servers = {}
local req = game:HttpGet("https://games.roblox.com/v1/games/" .. tostring(game.PlaceId) .. "/servers/Public?sortOrder=Desc&limit=100&excludeFullGames=true")
local body = game:GetService("HttpService"):JSONDecode(req)
if body and body.data then
for i, v in next, body.data do
if type(v) == "table" and tonumber(v.playing) and tonumber(v.maxPlayers) and v.playing < v.maxPlayers and v.id ~= JobId then
table.insert(servers, 1, v.id)
end
end
end
if #servers > 0 then
game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, servers[math.random(1, #servers)], LocalPlayer)
task.wait(5)
else
task.wait(10)
continue
end
end
end
if LocalPlayer.Team.Name ~= "Guards" then
if LocalPlayer.Team.Name == "Neutral" then
firesignal(LocalPlayer.PlayerGui.Home.intro.ContentBackground.Content.Menus.teamsGui.Guards.Button.MouseButton1Click)
end
task.wait(1)
if LocalPlayer.Team.Name ~= "Guards" then
if SERVER_HOPPING then
shop()
end
error("Failed to switch to guard and server hopping is disabled!")
end
end
LocalCharacter = LocalPlayer.Character
LocalHrp = LocalCharacter:WaitForChild("HumanoidRootPart")
LocalHumanoid = LocalCharacter:WaitForChild("Humanoid")
local udPart = Instance.new("Part")
udPart.Parent = workspace
udPart.Anchored = true
udPart.Size = Vector3.new(50, 5, 50)
udPart.Position = Vector3.new(871, 30, 2543)
LocalHrp.CFrame = udPart.CFrame + Vector3.new(0, 5, 0)
local isDead = false
function handleUd()
isDead = false
LocalHumanoid.Died:Connect(function()
isDead = true
LocalCharacter = LocalPlayer.CharacterAdded:Wait()
LocalHrp = LocalCharacter:WaitForChild("HumanoidRootPart")
LocalHumanoid = LocalCharacter:WaitForChild("Humanoid")
task.wait(1)
LocalHrp.CFrame = udPart.CFrame + Vector3.new(0, 5, 0)
handleUd()
end)
end
handleUd()
local lastArrestTime = tick()
while task.wait() do
local oldPosition = LocalHrp.CFrame
local handcuffs = LocalPlayer.Backpack:FindFirstChild("Handcuffs")
if isDead then continue end
if handcuffs then
handcuffs.Parent = LocalCharacter
end
task.wait(1)
for _, player in Players:GetPlayers() do
local targetCharacter = player.Character
if player == LocalPlayer
or not player.Team
or not targetCharacter
or targetCharacter.Head:FindFirstChild("handcuffedGui")
or not targetCharacter:FindFirstChild("Humanoid")
or isDead
then
continue
end
local targetHumanoid = targetCharacter.Humanoid
local targetHrp = targetCharacter.HumanoidRootPart
local isCriminal = player.Team.Name == "Criminals"
if isCriminal and targetHrp and targetHumanoid and targetHumanoid.Health > 0 then
repeat
task.wait()
LocalHumanoid.Sit = false
if not player.Character then break end
LocalHrp.CFrame = player.Character.HumanoidRootPart.CFrame - Vector3.new(0, 6, 0)
task.spawn(arrestPlayer.InvokeServer, arrestPlayer, player)
until not player.Character
or player.Character.Humanoid.Health <= 0
or player.Character.Head:FindFirstChild("handcuffedGui")
or LocalHumanoid.Health <= 0
LocalHumanoid.Sit = false
LocalHrp.CFrame = oldPosition
task.wait(5)
lastArrestTime = tick()
end
end
if tick() - lastArrestTime > 5 and SERVER_HOPPING and not isDead then
shop()
end
end
Comments
skidded gui