--BROUGHT TO YOU BY RobloxScripter.com!--
game:GetService"RunService".RenderStepped:Connect(function()
spawn(function()
for i = 0,10 do
local localPlayer = game:GetService("Players").LocalPlayer
local function booga()
local closestPlayer = nil
local shortestDistance = math.huge
for i, v in pairs(workspace.Zombies:GetChildren()) do
if v:FindFirstChild("Humanoid") and v.Humanoid.Health ~= 0 and v:FindFirstChild("Head") then
local magnitude = (v.Head.Position - localPlayer.Character.Head.Position).magnitude
if magnitude < shortestDistance then
closestPlayer = v
shortestDistance = magnitude
end
end
end
return closestPlayer
end
local args = {
[1] = booga().Head.Position,
[2] = booga().Head.CFrame,
[3] = {
[1] = booga().Head
}
}
game:GetService("ReplicatedStorage").RuddevRemotes.Shoot:FireServer(unpack(args))
end
end)
end)