local players = game:GetService("Players")
local rs = game:GetService("ReplicatedStorage")
local run = game:GetService("RunService")
local drone_code, hover, wait_h, wait_t, poll = "pg-7vl", 5, 0.2, 0.2, 0.05
local lp, char = players.LocalPlayer, players.LocalPlayer.Character or players.LocalPlayer.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local net = rs:WaitForChild("Network")
local create, explode = net:WaitForChild("CreateDrone"), net:WaitForChild("ExplodeDrone")
_G.drone_loop = true
local function get_target_part(model)
if model:IsA("Model") then
if model:FindFirstChild("HumanoidRootPart") then return model.HumanoidRootPart
elseif model.PrimaryPart then return model.PrimaryPart
else
for _, p in pairs(model:GetDescendants()) do
if p:IsA("BasePart") then return p end
end
end
end
return nil
end
local function nearest()
local n, s = nil, math.huge
for _, p in pairs(workspace:GetDescendants()) do
if p:IsA("BasePart") and not p.Anchored and not p:IsDescendantOf(char) then
local is_bot = workspace:FindFirstChild("Bots") and p:IsDescendantOf(workspace.Bots)
local is_player = false
for _, pl in pairs(players:GetPlayers()) do
if pl.Character and p:IsDescendantOf(pl.Character) then is_player = true break end
end
if not is_bot and not is_player then
local d = (hrp.Position - p.Position).Magnitude
if d < s then s, n = d, p end
end
end
end
return n
end
local function weighted_target()
local player_list = {}
for _, p in pairs(players:GetPlayers()) do
if p ~= lp and p.Character then
local part = get_target_part(p.Character)
if part then table.insert(player_list, part) end
end
end
local bot_list = {}
if workspace:FindFirstChild("Bots") then
for _, b in pairs(workspace.Bots:GetChildren()) do
local part = get_target_part(b)
if part then table.insert(bot_list, part) end
end
end
if #player_list == 0 and #bot_list > 0 then
return bot_list[math.random(1,#bot_list)]
elseif #bot_list == 0 and #player_list > 0 then
return player_list[math.random(1,#player_list)]
elseif #player_list > 0 and #bot_list > 0 then
if math.random() < 0.7 then
return player_list[math.random(1,#player_list)]
else
return bot_list[math.random(1,#bot_list)]
end
end
return nil
end
while _G.drone_loop do
local label = lp:WaitForChild("PlayerGui"):WaitForChild("Main"):WaitForChild("ImageLabel"):WaitForChild("droneText")
while label.Text=="0/2" do task.wait(0.1) end
pcall(function() create:InvokeServer(drone_code) end)
task.wait(0.2)
local part
repeat part=nearest() task.wait(poll) until part
print("Controlling:", part:GetFullName())
local hb = run.Heartbeat:Connect(function()
if part and part.Parent then part.CFrame = hrp.CFrame + Vector3.new(0, hover, 0)
else hb:Disconnect() end
end)
task.wait(wait_h) hb:Disconnect()
local target = weighted_target()
if target then part.CFrame = target.CFrame + Vector3.new(0, hover, 0) end
task.wait(1)
pcall(function() explode:FireServer() end)
endUses server authority to move the drone to the victim and activate a remote event that should instantly kill the player or bot. This is opensource if you want to turn it into a script of your own but just credit me if used.
No comments yet. Be the first to comment!
1local players = game:GetService("Players")
2local rs = game:GetService("ReplicatedStorage")
3local run = game:GetService("RunService")
4local drone_code, hover, wait_h, wait_t, poll = "pg-7vl", 5, 0.2, 0.2, 0.05
5local lp, char = players.LocalPlayer, players.LocalPlayer.Character or players.LocalPlayer.CharacterAdded:Wait()
6local hrp = char:WaitForChild("HumanoidRootPart")
7local net = rs:WaitForChild("Network")
8local create, explode = net:WaitForChild("CreateDrone"), net:WaitForChild("ExplodeDrone")
9_G.drone_loop = true
10
11local function get_target_part(model)
12 if model:IsA("Model") then
13 if model:FindFirstChild("HumanoidRootPart") then return model.HumanoidRootPart
14 elseif model.PrimaryPart then return model.PrimaryPart
15 else
16 for _, p in pairs(model:GetDescendants()) do
17 if p:IsA("BasePart") then return p end
18 end
19 end
20 end
21 return nil
22end
23local function nearest()
24 local n, s = nil, math.huge
25 for _, p in pairs(workspace:GetDescendants()) do
26 if p:IsA("BasePart") and not p.Anchored and not p:IsDescendantOf(char) then
27 local is_bot = workspace:FindFirstChild("Bots") and p:IsDescendantOf(workspace.Bots)
28 local is_player = false
29 for _, pl in pairs(players:GetPlayers()) do
30 if pl.Character and p:IsDescendantOf(pl.Character) then is_player = true break end
31 end
32 if not is_bot and not is_player then
33 local d = (hrp.Position - p.Position).Magnitude
34 if d < s then s, n = d, p end
35 end
36 end
37 end
38 return n
39end
40local function weighted_target()
41 local player_list = {}
42 for _, p in pairs(players:GetPlayers()) do
43 if p ~= lp and p.Character then
44 local part = get_target_part(p.Character)
45 if part then table.insert(player_list, part) end
46 end
47 end
48 local bot_list = {}
49 if workspace:FindFirstChild("Bots") then
50 for _, b in pairs(workspace.Bots:GetChildren()) do
51 local part = get_target_part(b)
52 if part then table.insert(bot_list, part) end
53 end
54 end
55 if #player_list == 0 and #bot_list > 0 then
56 return bot_list[math.random(1,#bot_list)]
57 elseif #bot_list == 0 and #player_list > 0 then
58 return player_list[math.random(1,#player_list)]
59 elseif #player_list > 0 and #bot_list > 0 then
60 if math.random() < 0.7 then
61 return player_list[math.random(1,#player_list)]
62 else
63 return bot_list[math.random(1,#bot_list)]
64 end
65 end
66 return nil
67end
68while _G.drone_loop do
69 local label = lp:WaitForChild("PlayerGui"):WaitForChild("Main"):WaitForChild("ImageLabel"):WaitForChild("droneText")
70 while label.Text=="0/2" do task.wait(0.1) end
71 pcall(function() create:InvokeServer(drone_code) end)
72 task.wait(0.2)
73 local part
74 repeat part=nearest() task.wait(poll) until part
75 print("Controlling:", part:GetFullName())
76 local hb = run.Heartbeat:Connect(function()
77 if part and part.Parent then part.CFrame = hrp.CFrame + Vector3.new(0, hover, 0)
78 else hb:Disconnect() end
79 end)
80 task.wait(wait_h) hb:Disconnect()
81 local target = weighted_target()
82 if target then part.CFrame = target.CFrame + Vector3.new(0, hover, 0) end
83 task.wait(1)
84 pcall(function() explode:FireServer() end)
85end