local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local plr = Players.LocalPlayer
local holdingV = false
local function INSTAKILLTHISNEBROID()
local char = plr.Character
if not char then return end
local HRP = char:FindFirstChild("HumanoidRootPart")
if not HRP then return end
local entities = workspace:FindFirstChild("World") and workspace.World:FindFirstChild("Entities")
if not entities then return end
local closest = nil
local DistFrM = math.huge
for _, Mob in pairs(entities:GetChildren()) do
if Mob:IsA("Model") and Mob ~= char then
local MobRoot = Mob:FindFirstChild("HumanoidRootPart")
local HumanoidN = Mob:FindFirstChild("Humanoid")
if MobRoot and HumanoidN and isnetworkowner(MobRoot) then
local dist = (HRP.Position - MobRoot.Position).Magnitude
if dist < DistFrM then
DistFrM = dist
closest = HumanoidN
end
end
end
end
if closest and closest.Health > 0 then
closest.Health = 0
end
end
UserInputService.InputBegan:Connect(function(INPETS, P)
if P then return end
if INPETS.KeyCode == Enum.KeyCode.V then
holdingV = true
INSTAKILLTHISNEBROID()
while holdingV do
INSTAKILLTHISNEBROID()
task.wait(0.08)
end
end
end)
UserInputService.InputEnded:Connect(function(INPETS)
if INPETS.KeyCode == Enum.KeyCode.V then
holdingV = false
end
end)
Comments
kill doesn't count even if you deal 80% damage to the NPC.