while true do
wait(0.5)
local char = plr.Character or plr.CharacterAdded:Wait()
if char then
if plr.Character:FindFirstChild("Handcuffs") then
for i,v in pairs(game.Players:GetChildren()) do
if v ~= plr then
if v.Character then
for o,p in pairs(v.Character:GetDescendants()) do -- this is line 14
if p:IsA("ProximityPrompt") and p.Name == "Arrest" then
p.Enabled = true
end
end
end
end
end
if v.Character then
local char = v.Character
for o, p in pairs(char:GetDescendants()) do -- this is line 14
if p:IsA("ProximityPrompt") and p.Name == "Arrest" then
p.Enabled = true
end
end
end
local plr = game.Players.LocalPlayer
local PickDebounce = false
local ArrestDebounce = false
coroutine.wrap(function()
while wait(0.5) do
local char = plr.Character or plr.CharacterAdded:Wait()
if char then
if plr.Character:FindFirstChild("Handcuffs") then
for i,v in pairs(game.Players:GetChildren()) do
if v ~= plr then
if v.Character then
for o,p in pairs(v.Character:GetDescendants()) do
if p:IsA("ProximityPrompt") and p.Name == "Arrest" then
p.Enabled = true
end
end
end
end
end
else
for i,v in pairs(game.Players:GetChildren()) do
if v.Character then
if v ~= plr then
for o,p in pairs(v.Character:GetDescendants()) do
if p:IsA("ProximityPrompt") and p.Name == "Arrest" then
p.Enabled = false
end
end
end
end
end
end
end
end
end)()
local players = game:GetService("Players")
local plr = players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local PickDebounce = false
local ArrestDebounce = false
coroutine.wrap(function()
while task.wait(0.5) do
if plr and char then
if char:FindFirstChild("Handcuffs") then
for _, player in pairs(players:GetPlayers()) do
if player ~= plr then
if player.Character then
local character = player.Character
for _, prompt in pairs(character:GetDescendants()) do
if prompt:IsA("ProximityPrompt") and prompt.Name == "Arrest" then
prompt.Enabled = true
end
end
end
end
end
elseif not char:FindFirstChild("Handcuffs") then
for _, player in pairs(players:GetPlayers()) do
if player ~= plr then
if player.Character then
local character = player.Character
for _, prompt in pairs(character:GetDescendants()) do
if prompt:IsA("ProximityPrompt") and prompt.Name == "Arrest" then
prompt.Enabled = false
end
end
end
end
end
end
end
end
end)()
You may need to increase the wait.task() time as running a loop through all players every 0.5 seconds might be too frequent.