local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local VIM = game:GetService("VirtualInputManager")
local RunService = game:GetService("RunService")
local animationIds = {
["126830014841198"] = true, ["126355327951215"] = true, ["121086746534252"] = true,
["18885909645"] = true, ["98456918873918"] = true, ["105458270463374"] = true,
["83829782357897"] = true, ["125403313786645"] = true, ["118298475669935"] = true,
["82113744478546"] = true, ["70371667919898"] = true, ["99135633258223"] = true,
["97167027849946"] = true, ["109230267448394"] = true, ["139835501033932"] = true,
["126896426760253"] = true, ["109667959938617"] = true, ["126681776859538"] = true,
["129976080405072"] = true, ["121293883585738"] = true,
}
local detectionRange = 15
local blockCooldown = false
local punchCooldown = false
local function autoPunch(targetRoot)
if punchCooldown then return end
punchCooldown = true
local myRoot = localPlayer.Character and localPlayer.Character:FindFirstChild("HumanoidRootPart")
if myRoot and targetRoot then
-- Instant Aim
local targetPos = Vector3.new(targetRoot.Position.X, myRoot.Position.Y, targetRoot.Position.Z)
myRoot.CFrame = CFrame.new(myRoot.Position, targetPos)
end
task.wait(0.05)
VIM:SendKeyEvent(true, Enum.KeyCode.R, false, game)
VIM:SendKeyEvent(false, Enum.KeyCode.R, false, game)
task.wait(0.5)
punchCooldown = false
end
local function instantBlock(targetRoot)
if blockCooldown then return end
blockCooldown = true
VIM:SendKeyEvent(true, Enum.KeyCode.Q, false, game)
VIM:SendKeyEvent(false, Enum.KeyCode.Q, false, game)
task.spawn(function()
autoPunch(targetRoot)
end)
task.wait(0.2)
blockCooldown = false
end
-- Core Detection Logic
local function checkCharacter(char)
if not char or char == localPlayer.Character then return end
local enemyRoot = char:FindFirstChild("HumanoidRootPart")
local enemyHum = char:FindFirstChildOfClass("Humanoid")
local myRoot = localPlayer.Character and localPlayer.Character:FindFirstChild("HumanoidRootPart")
if enemyRoot and enemyHum and myRoot then
local dist = (enemyRoot.Position - myRoot.Position).Magnitude
if dist <= detectionRange then
local animator = enemyHum:FindFirstChildOfClass("Animator")
if animator then
for _, track in ipairs(animator:GetPlayingAnimationTracks()) do
local id = string.match(track.Animation.AnimationId, "%d+")
if id and animationIds[id] then
task.spawn(instantBlock, enemyRoot)
break
end
end
end
end
end
end
RunService.Heartbeat:Connect(function()
-- 1. Check folder-based killers (Your basis script)
local killerFolder = workspace:FindFirstChild("Players") and workspace.Players:FindFirstChild("Killers")
if killerFolder then
for _, killer in ipairs(killerFolder:GetChildren()) do
checkCharacter(killer)
end
end
-- 2. Check all players (Backup in case folder is empty)
for _, player in ipairs(Players:GetPlayers()) do
if player ~= localPlayer and player.Character then
checkCharacter(player.Character)
end
end
end)
Comments
how to turn on it
At first I didn't work idk why
can you add facing check?
feel free to take the code for your own script not gona gatekeep it have fun cus its hard to find the anim ids