Version / Update: v1.0.0
- Download / Script Link
- --wait like 60 sec for network ownership before its gonna kill on server zombies
local Workspace = game:GetService("Workspace")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local function killNPC(humanoid)
if humanoid and humanoid.Parent and humanoid.Health > 0 then
humanoid:ChangeState(Enum.HumanoidStateType.Dead, true)
end
end
local function nearZombies()
local character = LocalPlayer.Character
if not character then return end
local rootPart = character:FindFirstChild("HumanoidRootPart") or character:FindFirstChildWhichIsA("BasePart")
if not rootPart then return end
local playerPos = rootPart.Position
local radius = 30
local descendants = Workspace:GetDescendants()
for _, obj in ipairs(descendants) do
if obj:IsA("Humanoid") then
local npcChar = obj.Parent
if not Players:GetPlayerFromCharacter(npcChar) then
local npcRoot = npcChar:FindFirstChild("HumanoidRootPart") or npcChar:FindFirstChildWhichIsA("BasePart")
if npcRoot then
local dist = (npcRoot.Position - playerPos).Magnitude
if dist <= radius then
killNPC(obj)
end
end
end
end
end
end
while task.wait(0.1) do
nearZombies()
end[ View More ]
wait like 60 sec for network ownership before its gonna kill on server zombies