
Beyond Nen Script Brick Hub: Auto Parry, Auto Fight
1 views

Use this Brick Hub for Beyond Nen Roblox!! Now you can get features like Auto Parry, Auto Fight, Auto Dodge, Cancel Attack and Avoid Red Zones, and More!! The Auto Parry panel shows Auto Parry, Parry, Heavy dodge, Cancel my atk and Avoid zones switched on, with Auto Fight left off until you want it. The author says it only parries attacks that really do damage, dodges heavy hits with Q and walks up to the boss to swing during its endlag. P turns everything on or off, G toggles Auto Fight and Right Ctrl hides the panel. It was made for beating the first boss. No key on this one, so paste the loadstring and go!!
Explore more scripts for this game (3)
--[[
Beyond Nen - Auto Parry / Dodge / Auto Fight (single file, GUI included)
- Automatic parry on the attacks that actually deal damage
- Dodge (Q) on heavy attacks, automatic exit from red telegraph zones
- Auto Fight: walks up to the boss and only attacks during its endlag
Target executors: Wave / Delta / Solara
Keys: [P] everything on/off | [G] Auto Fight | [Right Ctrl] hide the panel | [End] unload
Settings: see the CONFIG table below
]]
-- Prevent double execution: unload the previous instance first
local env = (getgenv and getgenv()) or _G
if env.BeyondNenAutoParry then
pcall(env.BeyondNenAutoParry)
end
---------------------------------------------------------------------
-- CONFIG (adjust per game / boss)
---------------------------------------------------------------------
local CONFIG = {
ParryKey = Enum.KeyCode.F, -- parry key in the game
ToggleKey = Enum.KeyCode.P, -- enable / disable everything
UnloadKey = Enum.KeyCode.End, -- unload the script
Range = 14, -- max distance (studs) of an attacker
FacingDot = 0.2, -- 1 = facing you exactly, -1 = back turned; >0.2 = roughly facing you
ReactionDelay = 0.12, -- delay before parrying after the animation starts (s)
HoldTime = 0.08, -- key press duration (s)
Cooldown = 0.35, -- minimum delay between two parries (s)
TargetPlayers = true, -- react to players
TargetNPCs = true, -- react to NPCs / mobs
-- Animation priorities treated as attacks
-- (Idle/Movement/Core are ignored: walking, running, jumping...)
ActionPriorities = {
[Enum.AnimationPriority.Action] = true,
[Enum.AnimationPriority.Action2] = true,
[Enum.AnimationPriority.Action3] = true,
[Enum.AnimationPriority.Action4] = true,
},
-- Words to ignore in animation names (lowercase)
IgnoreNames = { "idle", "walk", "run", "jump", "fall", "climb", "swim", "emote", "dance", "sit" },
-- Keywords that force detection even if the priority is low
ForceNames = { "attack", "slash", "punch", "swing", "strike", "hit", "m1", "combo", "skill", "nen" },
-- PARRY: only the animations that REALLY deal damage (measured from logs: they hit 0.38-0.43s after
-- the animation starts). The boss' other animations (feints / stances) never hit: parrying them
-- = a missed parry = 3s cooldown = you take everything.
ParryOnlyIds = true,
-- true = standard delay (ReactionDelay); number = specific press delay (s after the animation starts)
ParryIds = {
["100770856564580"] = true,
["130277557014228"] = true,
["91493878890049"] = true,
["93314100789910"] = true,
["93865528583760"] = 0.03, -- fast hit: lands 0.33s after the animation starts
},
PointBlank = 4, -- below this distance (studs) the attacker is always treated as a threat
NormalHitAt = 0.42, -- impact time of a normal hit (used for the dodge fallback)
-- DODGE (heavy attacks)
DodgeKey = Enum.KeyCode.Q, -- dodge / dash key in the game
HeavyNames = { "heavy", "smash", "slam", "charge", "critical", "crit", "ult", "finisher", "unblock", "grab", "m2" },
HeavyMinLength = 1.4, -- an animation longer than this (s) is considered heavy
DodgeLead = 0.30, -- the dodge starts X seconds BEFORE the impact (tunes the "perfect" dodge)
HeavyHitFraction = 0.85, -- estimated impact at x% of the real duration for an unknown heavy animation
-- Known heavy attacks: animation id -> impact time (s after the start, speed included)
-- at = fixed press delay (s): used for grab skills where you get locked and can no longer dash
-- (add your own with Debug = true)
HeavyDB = {
-- Slow big hit (slowed animation). ~0.6s in, the boss grabs you (flinch animation, no dash
-- possible), so we dash right away instead of waiting for the impact.
["120074647445778"] = { hit = 3.06, at = 0.05 },
-- Skills that grab you and launch you in the air (LastRag): you are locked (flinch animation, dash
-- impossible) 0.5-0.8s after the start -> dash IMMEDIATELY on the first animation.
["79940982521179"] = { hit = 1.98, at = 0.05 }, -- followed by 121888999208574 0.53s later
["116767125715788"] = { hit = 1.12, at = 0.05 }, -- followed by 122047448848886 0.52s later
["92614875456334"] = { hit = 1.54, at = 0.05 },
["90549446872856"] = { hit = 2.44 }, -- same hit, 0.62s later (duplicate is ignored automatically)
["121888999208574"] = { hit = 1.45 },
["96968963810616"] = { hit = 0.58 },
["108733713646184"] = { hit = 1.97 },
["101853308988006"] = { hit = 1.34 }, -- same hit as the previous one, 0.63s later
},
-- The game's dash needs a direction: if you are not moving, this key is held together with Q
DodgeDirKey = Enum.KeyCode.S, -- S = backwards (you face the boss)
DodgeDirHold = 0.15,
HeavyDedupeWindow = 0.9, -- two heavy animations whose impacts are within X s = a single hit
DodgeCooldown = 0.6, -- minimum delay between two dodges (s)
-- Animations to ignore completely: the boss' parry / stagger (otherwise we "react" to its own parry)
IgnoreIds = {
["14115657114"] = true,
["14115573519"] = true,
["17257966580"] = true,
},
-- Cancels your own attack (M1, combo...) right before parrying / dodging,
-- so that an attack in progress does not block the defensive action
CancelOwnAttack = true,
CancelFadeTime = 0.05, -- fade time (s) used to cut attack animations
ClearAttributes = { "Busy" }, -- character bool attributes reset to false ("busy" state)
ParryEnabled = true, -- parry on normal attacks (toggle in the GUI)
DodgeEnabled = true, -- dodge on heavy attacks (toggle in the GUI)
-- AUTO FIGHT: walks up to the boss and only hits (M1) while it is in "endlag" (after its own
-- attack or after your parry). Outside that window it parries your M1 and stuns you.
AutoFight = false, -- toggle in the GUI or with FightKey
FightKey = Enum.KeyCode.G,
BossNames = { "Evil" }, -- model names treated as bosses (besides anything with NpcEndlagUntil)
FightRange = 200, -- max distance to look for the boss
ApproachDist = 5.5, -- stop walking at this distance
AttackRange = 8, -- only attack below this distance
AttackMinEndlag = 0.30, -- only attack if the boss still has at least X s of endlag
ClickInterval = 0.20, -- delay between two M1 clicks
-- RED ZONES: big attacks place a telegraph on the ground. You have to LEAVE it, not just dash.
AvoidZones = true,
ZoneMinSize = 8, -- minimum largest dimension of a zone (studs)
ZoneMaxThickness = 3, -- zones are flat: max thickness (studs)
ZoneMargin = 2, -- safety margin around the zone
ZoneExitPad = 4, -- aim for a point X studs outside the zone
ZoneDashDist = 7, -- if the exit point is farther than this, dash as well
ZoneNames = { "telegraph", "warning", "indicator", "danger", "aoe", "markeroverlay" },
LogZones = false, -- writes every detected zone to apZones.txt (to tune the filters)
ShowGui = true, -- show the small panel
GuiToggleKey = Enum.KeyCode.RightControl, -- hide / show the panel
Debug = false, -- true: prints name/length/priority of every detected animation
}
---------------------------------------------------------------------
-- SERVICES
---------------------------------------------------------------------
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local VIM = game:GetService("VirtualInputManager")
local LocalPlayer = Players.LocalPlayer
---------------------------------------------------------------------
-- STATE
---------------------------------------------------------------------
local enabled = true
local lastParry = 0
local lastDodge = 0
local lastHeavyHit = -math.huge -- impact time (os.clock) of the last scheduled heavy hit
local fleeUntil = 0 -- while os.clock() < fleeUntil, auto fight does not move (we are leaving a zone)
local connections = {} -- global connections
local hooked = {} -- [Animator] = connection
local function track(conn)
table.insert(connections, conn)
return conn
end
---------------------------------------------------------------------
-- UTILITIES
---------------------------------------------------------------------
local function getRoot(model)
return model and (model:FindFirstChild("HumanoidRootPart") or model.PrimaryPart)
end
local function myRoot()
return getRoot(LocalPlayer.Character)
end
local function notify(text)
pcall(function()
game:GetService("StarterGui"):SetCore("SendNotification", {
Title = "Auto Parry",
Text = text,
Duration = 2,
})
end)
end
local function nameMatches(name, list)
name = string.lower(name or "")
for _, word in ipairs(list) do
if string.find(name, word, 1, true) then
return true
end
end
return false
end
-- Press a key (VirtualInputManager, with keypress fallback)
local function pressKey(keyCode)
local ok = pcall(function()
VIM:SendKeyEvent(true, keyCode, false, game)
task.wait(CONFIG.HoldTime)
VIM:SendKeyEvent(false, keyCode, false, game)
end)
if not ok and keypress and keyrelease then
local code = keyCode.Value
pcall(keypress, code)
task.wait(CONFIG.HoldTime)
pcall(keyrelease, code)
end
end
-- Cuts the local player's current attack to free up the defensive action
local function cancelOwnAttack()
local char = LocalPlayer.Character
if not char then return end
local animator = char:FindFirstChildWhichIsA("Animator", true)
if animator then
for _, animTrack in ipairs(animator:GetPlayingAnimationTracks()) do
if CONFIG.ActionPriorities[animTrack.Priority]
and not nameMatches(animTrack.Name, CONFIG.IgnoreNames) then
pcall(function() animTrack:Stop(CONFIG.CancelFadeTime) end)
end
end
end
for _, attr in ipairs(CONFIG.ClearAttributes) do
if char:GetAttribute(attr) == true then
pcall(function() char:SetAttribute(attr, false) end)
end
end
end
local function defend(keyCode, dirKey)
if CONFIG.CancelOwnAttack then
cancelOwnAttack()
task.wait() -- let the game register the cancellation before the key press
end
-- Dash: without a held direction the game ignores Q, so we hold a movement key
local dir = dirKey or CONFIG.DodgeDirKey
if keyCode == CONFIG.DodgeKey and dir then
local char = LocalPlayer.Character
local hum = char and char:FindFirstChildOfClass("Humanoid")
if dirKey or (hum and hum.MoveDirection.Magnitude < 0.1) then
pcall(function() VIM:SendKeyEvent(true, dir, false, game) end)
task.wait(0.04)
pressKey(keyCode)
task.wait(CONFIG.DodgeDirHold)
pcall(function() VIM:SendKeyEvent(false, dir, false, game) end)
return
end
end
pressKey(keyCode)
end
local function doParry()
local now = os.clock()
if now - lastParry < CONFIG.Cooldown then
return
end
lastParry = now
task.spawn(defend, CONFIG.ParryKey)
end
local function doDodge(dirKey)
local now = os.clock()
if now - lastDodge < CONFIG.DodgeCooldown then
return
end
lastDodge = now
task.spawn(defend, CONFIG.DodgeKey, dirKey)
end
---------------------------------------------------------------------
-- DETECTION
---------------------------------------------------------------------
-- Is the attacker close enough and facing us?
local function isThreat(attackerModel)
local mine, theirs = myRoot(), getRoot(attackerModel)
if not mine or not theirs then
return false
end
local offset = mine.Position - theirs.Position
local dist = offset.Magnitude
if dist > CONFIG.Range then
return false
end
if dist < 0.1 then
return true
end
-- in melee range the boss overlaps you: the facing test becomes noise
if dist <= CONFIG.PointBlank then
return true
end
local facing = theirs.CFrame.LookVector:Dot(offset.Unit)
return facing >= CONFIG.FacingDot
end
local function animName(animTrack)
local anim = animTrack.Animation
return (anim and anim.Name) or animTrack.Name or ""
end
local function animId(animTrack)
local anim = animTrack.Animation
return anim and string.match(anim.AnimationId, "%d+") or ""
end
local function isAttackAnimation(animTrack)
local name = animName(animTrack)
if nameMatches(name, CONFIG.ForceNames) then
return true
end
if nameMatches(name, CONFIG.IgnoreNames) then
return false
end
return CONFIG.ActionPriorities[animTrack.Priority] == true
end
-- Heavy attack: known id, explicit name or long animation
local function isHeavyAnimation(animTrack)
if CONFIG.HeavyDB[animId(animTrack)] then
return true
end
if nameMatches(animName(animTrack), CONFIG.HeavyNames) then
return true
end
-- length alone is not enough: otherwise long idles / emotes would count as "heavy"
return animTrack.Length >= CONFIG.HeavyMinLength and isAttackAnimation(animTrack)
end
local function onAnimationPlayed(attackerModel, animTrack)
if not enabled then return end
if CONFIG.IgnoreIds[animId(animTrack)] then return end
local heavy = CONFIG.DodgeEnabled and isHeavyAnimation(animTrack)
if not heavy and not (CONFIG.ParryEnabled and isAttackAnimation(animTrack)) then return end
if not isThreat(attackerModel) then return end
if CONFIG.Debug then
print(string.format("[AutoParry] %s | %s id=%s | len=%.2f | prio=%s | %s",
attackerModel.Name, animName(animTrack), animId(animTrack), animTrack.Length,
animTrack.Priority.Name, heavy and "DODGE" or "PARRY"))
end
if heavy then
-- Perfect dodge: aim for the impact time (known or estimated) minus DodgeLead.
-- No IsPlaying check here: the boss cuts/replaces its animations while the hit still lands.
local entry = CONFIG.HeavyDB[animId(animTrack)]
local speed = math.max(animTrack.Speed, 0.1)
local hitAt = entry and entry.hit or (animTrack.Length / speed) * CONFIG.HeavyHitFraction
local delay = entry and entry.at or math.max(0, hitAt - CONFIG.DodgeLead)
-- the same heavy hit often arrives through 2 animations: only one dash (cooldown ~2.3s)
local now = os.clock()
local absHit = now + hitAt
if math.abs(absHit - lastHeavyHit) < CONFIG.HeavyDedupeWindow and lastHeavyHit > now - 0.2 then
return
end
lastHeavyHit = absHit
task.delay(delay, function()
if enabled and CONFIG.DodgeEnabled and isThreat(attackerModel) then
doDodge()
end
end)
return
end
-- animation that never deals damage: don't waste the parry
if CONFIG.ParryOnlyIds and not CONFIG.ParryIds[animId(animTrack)] then return end
local pressDelay = CONFIG.ParryIds[animId(animTrack)]
if type(pressDelay) ~= "number" then pressDelay = CONFIG.ReactionDelay end
task.delay(pressDelay, function()
-- re-check: the animation is still playing and the threat is still there
if not (enabled and animTrack.IsPlaying and isThreat(attackerModel)) then return end
local char = LocalPlayer.Character
if char and char:GetAttribute("ParryOnCooldown") == true then
-- parry unavailable: F would only block. Dodge instead if the dash is free.
if CONFIG.DodgeEnabled and char:GetAttribute("DashCooldown") ~= true then
local wait = math.max(0, CONFIG.NormalHitAt - CONFIG.DodgeLead - CONFIG.ReactionDelay)
task.delay(wait, function()
if enabled and isThreat(attackerModel) then doDodge() end
end)
end
return
end
doParry()
end)
end
---------------------------------------------------------------------
-- HOOKING THE ANIMATORS
---------------------------------------------------------------------
local function shouldWatch(model)
if model == LocalPlayer.Character then
return false
end
local isPlayer = Players:GetPlayerFromCharacter(model) ~= nil
if isPlayer then
return CONFIG.TargetPlayers
end
return CONFIG.TargetNPCs
end
local function hookAnimator(animator)
if hooked[animator] then return end
local model = animator:FindFirstAncestorOfClass("Model")
if not model or not shouldWatch(model) then return end
hooked[animator] = animator.AnimationPlayed:Connect(function(animTrack)
onAnimationPlayed(model, animTrack)
end)
animator.Destroying:Connect(function()
if hooked[animator] then
hooked[animator]:Disconnect()
hooked[animator] = nil
end
end)
end
for _, inst in ipairs(workspace:GetDescendants()) do
if inst:IsA("Animator") then
hookAnimator(inst)
end
end
track(workspace.DescendantAdded:Connect(function(inst)
if inst:IsA("Animator") then
-- small delay: the model is not always parented yet at this point
task.defer(hookAnimator, inst)
end
end))
---------------------------------------------------------------------
-- AUTO FIGHT
---------------------------------------------------------------------
local bossModel
local lastScan, lastClick = 0, 0
local function isBoss(model)
if model == LocalPlayer.Character or Players:GetPlayerFromCharacter(model) then
return false
end
if model:GetAttribute("NpcEndlagUntil") ~= nil then
return true
end
return table.find(CONFIG.BossNames, model.Name) ~= nil
end
local function bossAlive(model)
if not model or not model.Parent then return false end
local hum = model:FindFirstChildOfClass("Humanoid")
return hum ~= nil and hum.Health > 0 and getRoot(model) ~= nil
end
local function findBoss()
local root = myRoot()
if not root then return nil end
local best, bestDist = nil, CONFIG.FightRange
for _, inst in ipairs(workspace:GetDescendants()) do
if inst:IsA("Humanoid") then
local model = inst.Parent
if model and model:IsA("Model") and isBoss(model) and bossAlive(model) then
local d = (getRoot(model).Position - root.Position).Magnitude
if d < bestDist then best, bestDist = model, d end
end
end
end
return best
end
-- time left (s) before the boss' endlag ends; <= 0 = it can parry your M1
local function endlagLeft(model)
local untilAt = model:GetAttribute("NpcEndlagUntil")
if type(untilAt) ~= "number" then return 0 end
return untilAt - workspace:GetServerTimeNow()
end
local function clickM1()
local cam = workspace.CurrentCamera
local c = cam and (cam.ViewportSize / 2) or Vector2.new(400, 300)
local ok = pcall(function()
VIM:SendMouseButtonEvent(c.X, c.Y, 0, true, game, 0)
task.wait(0.03)
VIM:SendMouseButtonEvent(c.X, c.Y, 0, false, game, 0)
end)
if not ok and mouse1click then
pcall(mouse1click) -- fallback for executors without VirtualInputManager
end
end
local fightAccum = 0
track(RunService.Heartbeat:Connect(function(dt)
fightAccum += dt
if fightAccum < 0.05 then return end
fightAccum = 0
if not (enabled and CONFIG.AutoFight) then return end
local char = LocalPlayer.Character
local hum = char and char:FindFirstChildOfClass("Humanoid")
local root = myRoot()
if not (hum and root and hum.Health > 0) then return end
local now = os.clock()
if now < fleeUntil then return end -- we are leaving a red zone
if not bossAlive(bossModel) and now - lastScan > 1 then
lastScan = now
bossModel = findBoss()
end
if not bossAlive(bossModel) then return end
-- don't touch anything while dashing (it would break the dodge)
if char:GetAttribute("LocalDashing") ~= nil or char:GetAttribute("ActiveDashId") ~= nil then return end
local bpos = getRoot(bossModel).Position
local flat = Vector3.new(bpos.X - root.Position.X, 0, bpos.Z - root.Position.Z)
local dist = flat.Magnitude
-- face the boss
if dist > 0.5 and dist < 40 then
root.CFrame = CFrame.lookAt(root.Position, root.Position + flat)
end
-- approach
if dist > CONFIG.ApproachDist then
hum:MoveTo(bpos)
end
-- only attack during the boss' endlag
if dist <= CONFIG.AttackRange
and endlagLeft(bossModel) >= CONFIG.AttackMinEndlag
and now - lastClick >= CONFIG.ClickInterval then
lastClick = now
task.spawn(clickM1)
end
end))
---------------------------------------------------------------------
-- RED ZONES (telegraphs of big attacks)
---------------------------------------------------------------------
local zones = {} -- [BasePart] = time it appeared
local function zoneLog(line)
if CONFIG.LogZones and appendfile then
pcall(appendfile, "apZones.txt", string.format("%.2f|%s\n", os.clock(), line))
end
end
local function belongsToCharacter(inst)
local m = inst:FindFirstAncestorOfClass("Model")
while m do
if m:FindFirstChildOfClass("Humanoid") then return true end
m = m.Parent and m.Parent:FindFirstAncestorOfClass("Model")
end
return false
end
local function isRedish(c)
return c.R >= 0.6 and c.G <= 0.4 and c.B <= 0.4
end
local function zoneCandidate(part)
if belongsToCharacter(part) then return false end
-- the boss' real zones are called BossTelegraph*: accepted whatever their size
-- (the "Fill" grows over time, it is small when it appears)
if nameMatches(part.Name, CONFIG.ZoneNames) or nameMatches(part.Parent and part.Parent.Name or "", CONFIG.ZoneNames) then
return true
end
local s = part.Size
local mx, mn = math.max(s.X, s.Y, s.Z), math.min(s.X, s.Y, s.Z)
if mx < CONFIG.ZoneMinSize or mn > CONFIG.ZoneMaxThickness then return false end
return part.Transparency < 0.98 and isRedish(part.Color)
end
-- Telemetry: follows a "telegraph" zone for ~2s (size, position in the boss' frame of reference)
local function watchTelegraph(part)
task.spawn(function()
local boss = bossModel
if not (boss and boss.Parent) then
for _, m in ipairs(workspace:GetDescendants()) do
if m:IsA("Model") and table.find(CONFIG.BossNames, m.Name) and m:FindFirstChildOfClass("Humanoid") then boss = m break end
end
end
local broot = boss and getRoot(boss)
for i = 1, 20 do
if not part.Parent then zoneLog(part.Name .. " destroyed at +" .. string.format("%.2f", (i - 1) * 0.1)) return end
local mine = myRoot()
local rel = broot and broot.CFrame:PointToObjectSpace(part.Position) or Vector3.zero
local me = (broot and mine) and broot.CFrame:PointToObjectSpace(mine.Position) or Vector3.zero
zoneLog(string.format(" %s +%.1fs size=%s transp=%.2f center(boss space)=%s me(boss space)=%s",
part.Name, (i - 1) * 0.1, tostring(part.Size), part.Transparency, tostring(rel), tostring(me)))
task.wait(0.1)
end
end)
end
-- axes: (thickness, u, v) in the part's local coordinates
local function zoneAxes(part)
local s = part.Size
if s.X <= s.Y and s.X <= s.Z then return "X", "Y", "Z" end
if s.Y <= s.Z then return "Y", "X", "Z" end
return "Z", "X", "Y"
end
-- returns (inside, world exit point)
local function zoneTest(part, pos)
local cf, s = part.CFrame, part.Size
local lp = cf:PointToObjectSpace(pos)
local t, u, v = zoneAxes(part)
if math.abs(lp[t]) > s[t] / 2 + 12 then return false end
local hu, hv = s[u] / 2 + CONFIG.ZoneMargin, s[v] / 2 + CONFIG.ZoneMargin
local pu, pv = lp[u], lp[v]
local round = part:IsA("Part") and (part.Shape == Enum.PartType.Ball or part.Shape == Enum.PartType.Cylinder)
local inside, tu, tv
if round then
local k = (pu / hu) ^ 2 + (pv / hv) ^ 2
inside = k <= 1
if k < 0.01 then
-- right at the center: arbitrary exit direction (u axis)
tu, tv = hu + CONFIG.ZoneExitPad, 0
else
local len = math.sqrt(k)
tu, tv = pu / len * (1 + CONFIG.ZoneExitPad / hu), pv / len * (1 + CONFIG.ZoneExitPad / hv)
end
else
inside = math.abs(pu) <= hu and math.abs(pv) <= hv
if math.abs(hu - math.abs(pu)) <= math.abs(hv - math.abs(pv)) then
tu = (pu >= 0 and 1 or -1) * (hu + CONFIG.ZoneExitPad); tv = pv
else
tv = (pv >= 0 and 1 or -1) * (hv + CONFIG.ZoneExitPad); tu = pu
end
end
if not inside then return false end
local target = { X = 0, Y = 0, Z = 0 }
target[t], target[u], target[v] = lp[t], tu, tv
return true, cf:PointToWorldSpace(Vector3.new(target.X, target.Y, target.Z))
end
local function registerZone(part)
if zones[part] or not part:IsA("BasePart") then return end
if not zoneCandidate(part) then return end
zones[part] = os.clock()
local mine = myRoot()
zoneLog(string.format("ZONE %s | %s | size=%s | color=%s | transp=%.2f | shape=%s | dist=%.1f",
part:GetFullName(), part.ClassName, tostring(part.Size), tostring(part.Color), part.Transparency,
part:IsA("Part") and part.Shape.Name or "-", mine and (mine.Position - part.Position).Magnitude or -1))
part.Destroying:Connect(function() zones[part] = nil end)
if CONFIG.LogZones and nameMatches(part.Name, CONFIG.ZoneNames) then
watchTelegraph(part)
end
end
track(workspace.DescendantAdded:Connect(function(inst)
if inst:IsA("BasePart") then
-- give the properties (size / color) time to be set
task.delay(0.05, function() if inst.Parent then registerZone(inst) end end)
elseif CONFIG.LogZones and nameMatches(inst.Name, CONFIG.ZoneNames) then
zoneLog("OTHER " .. inst.ClassName .. " " .. inst:GetFullName())
end
end))
local zoneAccum = 0
track(RunService.Heartbeat:Connect(function(dt)
zoneAccum += dt
if zoneAccum < 0.05 then return end
zoneAccum = 0
if not (enabled and CONFIG.AvoidZones) then return end
local char = LocalPlayer.Character
local hum = char and char:FindFirstChildOfClass("Humanoid")
local root = myRoot()
if not (hum and root and hum.Health > 0) then return end
local bestExit
for part in pairs(zones) do
if not part.Parent then
zones[part] = nil
else
local inside, exitPos = zoneTest(part, root.Position)
if inside then bestExit = exitPos break end
end
end
if not bestExit then return end
fleeUntil = os.clock() + 0.4
local toExit = Vector3.new(bestExit.X - root.Position.X, 0, bestExit.Z - root.Position.Z)
hum:MoveTo(bestExit)
-- too far to walk out in time: dash toward the exit
if toExit.Magnitude > CONFIG.ZoneDashDist and char:GetAttribute("DashCooldown") ~= true
and char:GetAttribute("LocalDashing") == nil then
local cam = workspace.CurrentCamera
local look = Vector3.new(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z).Unit
local right = Vector3.new(cam.CFrame.RightVector.X, 0, cam.CFrame.RightVector.Z).Unit
local dirn = toExit.Unit
local f, r = dirn:Dot(look), dirn:Dot(right)
local key
if math.abs(f) >= math.abs(r) then key = f >= 0 and Enum.KeyCode.W or Enum.KeyCode.S
else key = r >= 0 and Enum.KeyCode.D or Enum.KeyCode.A end
doDodge(key)
end
end))
---------------------------------------------------------------------
-- GUI (small draggable panel with toggle switches)
---------------------------------------------------------------------
local screenGui
local refreshGui = function() end
local function buildGui()
local parent
if gethui then
local ok, h = pcall(gethui)
parent = ok and h or nil
end
if not parent then
local ok, cg = pcall(function() return game:GetService("CoreGui") end)
parent = ok and cg or LocalPlayer:WaitForChild("PlayerGui")
end
screenGui = Instance.new("ScreenGui")
screenGui.Name = "BeyondNenAutoParry"
screenGui.ResetOnSpawn = false
screenGui.DisplayOrder = 999
screenGui.Parent = parent
local ON, OFF = Color3.fromRGB(46, 160, 90), Color3.fromRGB(70, 70, 78)
local frame = Instance.new("Frame")
frame.Size = UDim2.fromOffset(176, 0)
frame.AutomaticSize = Enum.AutomaticSize.Y
frame.Position = UDim2.new(0, 20, 0.4, 0)
frame.BackgroundColor3 = Color3.fromRGB(24, 24, 30)
frame.BorderSizePixel = 0
frame.Parent = screenGui
Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 8)
local pad = Instance.new("UIPadding", frame)
pad.PaddingBottom = UDim.new(0, 6)
pad.PaddingLeft, pad.PaddingRight = UDim.new(0, 6), UDim.new(0, 6)
local list = Instance.new("UIListLayout", frame)
list.Padding = UDim.new(0, 4)
list.SortOrder = Enum.SortOrder.LayoutOrder
-- title bar (also the drag handle)
local title = Instance.new("TextLabel")
title.LayoutOrder = 0
title.Size = UDim2.new(1, 0, 0, 26)
title.BackgroundTransparency = 1
title.Font = Enum.Font.GothamBold
title.TextSize = 13
title.TextColor3 = Color3.fromRGB(235, 235, 240)
title.Text = "Auto Parry"
title.Parent = frame
local dragging, dragStart, startPos
track(title.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1
or input.UserInputType == Enum.UserInputType.Touch then
dragging, dragStart, startPos = true, input.Position, frame.Position
end
end))
track(UserInputService.InputChanged:Connect(function(input)
if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement
or input.UserInputType == Enum.UserInputType.Touch) then
local d = input.Position - dragStart
frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + d.X,
startPos.Y.Scale, startPos.Y.Offset + d.Y)
end
end))
track(UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1
or input.UserInputType == Enum.UserInputType.Touch then
dragging = false
end
end))
-- switches: { label, getter, setter }
local rows = {
{ "Auto Parry", function() return enabled end, function(v) enabled = v end },
{ "Parry", function() return CONFIG.ParryEnabled end, function(v) CONFIG.ParryEnabled = v end },
{ "Heavy dodge", function() return CONFIG.DodgeEnabled end, function(v) CONFIG.DodgeEnabled = v end },
{ "Cancel my atk", function() return CONFIG.CancelOwnAttack end, function(v) CONFIG.CancelOwnAttack = v end },
{ "Avoid zones", function() return CONFIG.AvoidZones end, function(v) CONFIG.AvoidZones = v end },
{ "Auto Fight", function() return CONFIG.AutoFight end, function(v) CONFIG.AutoFight = v end },
}
local buttons = {}
for i, row in ipairs(rows) do
local btn = Instance.new("TextButton")
btn.LayoutOrder = i
btn.Size = UDim2.new(1, 0, 0, 28)
btn.AutoButtonColor = true
btn.BorderSizePixel = 0
btn.Font = Enum.Font.Gotham
btn.TextSize = 12
btn.TextColor3 = Color3.new(1, 1, 1)
btn.Parent = frame
Instance.new("UICorner", btn).CornerRadius = UDim.new(0, 6)
track(btn.MouseButton1Click:Connect(function()
row[3](not row[2]())
refreshGui()
end))
buttons[i] = btn
end
refreshGui = function()
for i, row in ipairs(rows) do
local on = row[2]()
buttons[i].Text = row[1] .. " " .. (on and "ON" or "OFF")
buttons[i].BackgroundColor3 = on and ON or OFF
end
-- sub-options are dimmed while the auto parry is off
for i = 2, #rows do
buttons[i].TextTransparency = enabled and 0 or 0.5
end
end
refreshGui()
end
if CONFIG.ShowGui then
local ok, err = pcall(buildGui)
if not ok then
warn("[AutoParry] GUI unavailable: " .. tostring(err))
end
end
---------------------------------------------------------------------
-- KEYS + UNLOAD
---------------------------------------------------------------------
local function unload()
enabled = false
if screenGui then
pcall(function() screenGui:Destroy() end)
screenGui = nil
end
for _, conn in ipairs(connections) do
pcall(function() conn:Disconnect() end)
end
for animator, conn in pairs(hooked) do
pcall(function() conn:Disconnect() end)
hooked[animator] = nil
end
env.BeyondNenAutoParry = nil
notify("Unloaded")
end
env.BeyondNenAutoParry = unload
track(UserInputService.InputBegan:Connect(function(input, processed)
if processed then return end
if input.KeyCode == CONFIG.ToggleKey then
enabled = not enabled
refreshGui()
notify(enabled and "Enabled" or "Disabled")
elseif input.KeyCode == CONFIG.FightKey then
CONFIG.AutoFight = not CONFIG.AutoFight
refreshGui()
notify("Auto Fight " .. (CONFIG.AutoFight and "ON" or "OFF"))
elseif input.KeyCode == CONFIG.GuiToggleKey then
if screenGui then
screenGui.Enabled = not screenGui.Enabled
end
elseif input.KeyCode == CONFIG.UnloadKey then
unload()
end
end))
notify("Loaded - [" .. CONFIG.ToggleKey.Name .. "] on/off, [" .. CONFIG.UnloadKey.Name .. "] unload")