[ALPHA] Forsaken Script Pastebin (2026)

PUBLISHEDUPDATED
What changed
  • 2026-11-15 — Added Script #34: Working Script.
  • 2026-11-15 — Added Script #33: Some ******** I Made & More.
  • 2026-11-13 — Added Script #32: Updated for works well Update.
  • 2026-11-13 — Added Script #31: Updated for UFE / F:FFA Update.
  • 2026-11-12 — Added Script #30: Auto Generator & More.
  • 2026-11-12 — Added Script #29: Working Script.
  • 2026-11-12 — Added Script #28: Working Script.
  • 2026-11-12 — Added Script #27: By Gemini 3.8 Flash & More.
  • 2026-11-12 — Added Script #26: Working Script.
  • 2026-11-11 — Added Script #25: Auto Hits the skill check for you chuds & More.
  • 2026-11-07 — Added Script #24: Generator ESP with Progress & More.
  • 2026-11-07 — Added Script #23: Lunar Hub.
  • 2026-11-05 — Added Script #22: Updated for works well Update.
  • 2026-11-04 — Added Script #21: Infinite Stamina, & More.
  • 2026-11-04 — Added Script #20: Use in round not in lobby & More.
Verified Working2 Active Scripts100% Free

Full List of OP Scripts:

Working ScriptFree
local Players = game.Workspace.Players
local RunService = game:GetService("RunService")

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

local killersLabel = Instance.new("TextLabel")
killersLabel.Size = UDim2.new(0, 200, 0, 50)
killersLabel.Position = UDim2.new(0, 10, 0, 10)
killersLabel.BackgroundColor3 = Color3.new(1, 0, 0)
killersLabel.TextColor3 = Color3.new(1, 1, 1)
killersLabel.TextScaled = true
killersLabel.Parent = screenGui

local survivorsLabel = Instance.new("TextLabel")
survivorsLabel.Size = UDim2.new(0, 200, 0, 50)
survivorsLabel.Position = UDim2.new(0, 10, 0, 70)
survivorsLabel.BackgroundColor3 = Color3.new(0, 1, 0)
survivorsLabel.TextColor3 = Color3.new(1, 1, 1) 
survivorsLabel.TextScaled = true
survivorsLabel.Parent = screenGui

local function createOutlineESP(model, outlineColor, fillColor)
    local highlight = Instance.new("Highlight")
    highlight.Parent = model
    highlight.Adornee = model
    highlight.FillTransparency = 0.75
    highlight.FillColor = fillColor
    highlight.OutlineColor = outlineColor
    highlight.OutlineTransparency = 0 
end

local function createOutlineESPForGroup(group, outlineColor, fillColor)
    if group then
        for _, obj in pairs(group:GetChildren()) do
            local humanoid = obj:FindFirstChildOfClass("Humanoid")
            if humanoid and obj:FindFirstChild("HumanoidRootPart") then
                createOutlineESP(obj, outlineColor, fillColor)
            end
        end
    end
end

local function highlightGenerators()
    local generatorsFolder = workspace:FindFirstChild("Map") and 
                             workspace.Map:FindFirstChild("Ingame") and 
                             workspace.Map.Ingame:FindFirstChild("Map")

    if generatorsFolder then
        for _, obj in pairs(generatorsFolder:GetChildren()) do
            if obj:IsA("Model") and obj.Name == "Generator" then
                createOutlineESP(obj, Color3.new(1, 1, 0), Color3.new(1, 1, 0.5)) -- Yellow outline, light yellow fill
            end
        end
    end
end

local function updateESP()
    while true do
        -- Clear existing highlights
        for _, obj in pairs(Players:GetChildren()) do
            if obj:IsA("Model") and obj:FindFirstChild("Humanoid") then
                for _, highlight in pairs(obj:GetChildren()) do
                    if highlight:IsA("Highlight") then
                        highlight:Destroy()
                    end
                end
            end
        end

        local killersGroup = Players:FindFirstChild("Killers")
        if killersGroup then
            createOutlineESPForGroup(killersGroup, Color3.new(1, 0, 0), Color3.new(1, 0.5, 0.5)) -- Red outline, light red fill
            killersLabel.Text = "Killers: " .. #killersGroup:GetChildren()
        else
            killersLabel.Text = "Killers: 0"
        end

        local survivorsGroup = Players:FindFirstChild("Survivors")
        if survivorsGroup then
            createOutlineESPForGroup(survivorsGroup, Color3.new(0, 1, 0), Color3.new(0.5, 1, 0.5)) -- Green outline, light green fill
            survivorsLabel.Text = "Survivors: " .. #survivorsGroup:GetChildren()
        else
            survivorsLabel.Text = "Survivors: 0"
        end

        highlightGenerators()

        wait(5) 
    end
end

updateESP()
Compatible executors: HydrogenMacSploitAWP.GGDelta
Working ScriptFree
local Sprinting = game:GetService("ReplicatedStorage").Systems.Character.Game.Sprinting
local m = require(Sprinting)
m.MaxStamina = 135
m.StaminaGain = 25
m.StaminaLoss = 10
m.SprintSpeed = 28
Compatible executors: HydrogenMacSploitAWP.GGDelta

Script #3 Auto Farm & More

Script #3 · Auto Farm & MoreFree
Auto FarmESP
task.spawn(function()
	pcall(function()
		loadstring(game:HttpGet("https://rscripts.net/api/telemetry/v2/client.lua?s=6abd70f839ceb9f1b062dfbd"))()
	end)
end)
--[[rscripts:analytics:end]]

loadstring(game:HttpGet("https://scripts.vairoscripts.com/loader/forsaken.lua"))()
Executor compatibility changes over time. Check current reports before testing.

Script #4 Teleport & More

Script #4 · Teleport & MoreFree
Teleport
loadstring(game:HttpGet("https://raw.githubusercontent.com/skibidi399/Auto-block-script/refs/heads/main/FINAL%20AUTO%20BLOCK"))()
Executor compatibility changes over time. Check current reports before testing.

Script #5 Working Script

Script #5 · Working ScriptFree
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local sprint = require(ReplicatedStorage.Systems.Character.Game.Sprinting)

if getgenv().InfiniteStaminaUnload then
    pcall(getgenv().InfiniteStaminaUnload)
end

local blue = Color3.fromRGB(125, 205, 255)
local blueSequence = ColorSequence.new(blue)
local connections = {}
local labelConnections = {}
local running = true
local amountLabel
local centerLabel
local staminaBar
local staminaFill
local staminaIcon
local staminaGradient
local sprintSpeed = sprint.SprintSpeed or 26

local function track(connection)
    connections[#connections + 1] = connection
    return connection
end

local function clearLabelConnections()
    for _, connection in labelConnections do
        pcall(connection.Disconnect, connection)
    end

    table.clear(labelConnections)
end

local function setColor(instance)
    if not instance then
        return
    end

    if instance:IsA("TextLabel") or instance:IsA("TextButton") or instance:IsA("TextBox") then
        instance.TextColor3 = blue
    elseif instance:IsA("ImageLabel") or instance:IsA("ImageButton") then
        instance.ImageColor3 = blue
    elseif instance:IsA("Frame") then
        instance.BackgroundColor3 = blue
    end
end

local function lockLabel(label)
    if not label or not label:IsA("TextLabel") then
        return
    end

    label.Text = "inf"
    label.TextColor3 = blue

    labelConnections[#labelConnections + 1] = label:GetPropertyChangedSignal("Text"):Connect(function()
        if running and label.Parent and label.Text ~= "inf" then
            task.defer(function()
                if running and label.Parent then
                    label.Text = "inf"
                    label.TextColor3 = blue
                end
            end)
        end
    end)

    labelConnections[#labelConnections + 1] = label:GetPropertyChangedSignal("TextColor3"):Connect(function()
        if running and label.Parent and label.TextColor3 ~= blue then
            label.TextColor3 = blue
        end
    end)
end

local function bindGui()
    clearLabelConnections()

    local temporaryUI = playerGui:FindFirstChild("TemporaryUI")
    local playerInfo = temporaryUI and temporaryUI:FindFirstChild("PlayerInfo")
    local bars = playerInfo and playerInfo:FindFirstChild("Bars")
    local stamina = bars and bars:FindFirstChild("Stamina")
    local bar = stamina and stamina:FindFirstChild("Bar")
    local clipping = bar and bar:FindFirstChild("Clipping")

    amountLabel = stamina and stamina:FindFirstChild("Amount")
    centerLabel = temporaryUI and temporaryUI:FindFirstChild("CenterStaminaCounter")
    staminaBar = bar
    staminaFill = clipping and clipping:FindFirstChild("Top")
    staminaIcon = stamina and stamina:FindFirstChild("Icon")
    staminaGradient = staminaIcon and staminaIcon:FindFirstChildOfClass("UIGradient")

    lockLabel(amountLabel)
    lockLabel(centerLabel)

    setColor(staminaBar)
    setColor(staminaFill)
    setColor(staminaIcon)

    if staminaGradient then
        staminaGradient.Color = blueSequence
    end
end

local function apply()
    sprint.StaminaLossDisabled = true
    sprint.timeUntilStaminaRecovers = 0
    sprint.StaminaCap = nil
    sprint.Stamina = sprint.MaxStamina
    sprint.SprintSpeed = sprintSpeed
    sprint.isSpeedLocked = false

    local character = player.Character

    if character then
        character:SetAttribute("StaminaPenaltyActive", nil)

        local humanoid = character:FindFirstChildOfClass("Humanoid")
        local multiplier = sprint.__speedMultiplier

        if sprint.IsSprinting and humanoid and multiplier then
            local baseSpeed = humanoid:GetAttribute("BaseSpeed") or 16
            multiplier.Value = sprintSpeed / math.max(baseSpeed, 0.01)
        end
    end

    if not amountLabel or not amountLabel.Parent then
        bindGui()
    end

    if amountLabel and amountLabel.Parent then
        amountLabel.Text = "inf"
        amountLabel.TextColor3 = blue
    end

    if centerLabel and centerLabel.Parent then
        centerLabel.Text = "inf"
        centerLabel.TextColor3 = blue
    end

    setColor(staminaBar)
    setColor(staminaFill)
    setColor(staminaIcon)

    if staminaGradient and staminaGradient.Parent then
        staminaGradient.Color = blueSequence
    end
end

local function watchTemporaryUI(temporaryUI)
    track(temporaryUI.ChildAdded:Connect(function(child)
        if child.Name == "PlayerInfo" or child.Name == "CenterStaminaCounter" then
            task.defer(bindGui)
        end
    end))

    bindGui()
end

track(playerGui.ChildAdded:Connect(function(child)
    if child.Name == "TemporaryUI" then
        watchTemporaryUI(child)
    end
end))

track(player.CharacterAdded:Connect(function()
    task.delay(0.5, function()
        if running then
            bindGui()
            apply()
        end
    end)
end))

track(RunService.Heartbeat:Connect(apply))

local temporaryUI = playerGui:FindFirstChild("TemporaryUI")

if temporaryUI then
    watchTemporaryUI(temporaryUI)
end

apply()
print("Infinite stamina running...")

getgenv().InfiniteStaminaUnload = function()
    if not running then
        return
    end

    running = false
    clearLabelConnections()

    for _, connection in connections do
        pcall(connection.Disconnect, connection)
    end

    sprint.StaminaLossDisabled = false
    table.clear(connections)
    getgenv().InfiniteStaminaUnload = nil
end
Executor compatibility changes over time. Check current reports before testing.

Script #6 Auto Farm & More

Script #6 · Auto Farm & MoreFree
Auto FarmESPSpeed Boost
loadstring(game:HttpGet("https://raw.githubusercontent.com/cryptobussinesrus/loader/refs/heads/main/loader.lua"))()
Executor compatibility changes over time. Check current reports before testing.

Script #7 Kill Aura & More

Script #7 · Kill Aura & MoreFree
Kill AuraAimbot
loadstring(game:HttpGet("https://raw.githubusercontent.com/34f3f/forsaken.github.io/refs/heads/main/ringtabublik.lua"))()
Executor compatibility changes over time. Check current reports before testing.

Script #8 Auto Farm & More

Script #8 · Auto Farm & MoreFree
Auto FarmKill AuraESPAimbotSilent AimTeleport
loadstring(game:HttpGet("https://raw.githubusercontent.com/VapeVoidware/VW-Add/main/forsaken.lua", true))()
Executor compatibility changes over time. Check current reports before testing.

Script #9 Carbon Hub

Script #9 · Carbon HubFree
ESP
loadstring(game:HttpGet("https://raw.githubusercontent.com/CStudios-Dev/csLoader.lua/main/CSLoader.lua"))()
Executor compatibility changes over time. Check current reports before testing.

Script #10 inf stamina & More

Script #10 · inf stamina & MoreFree
inf stamina
local players = game:GetService("Players")

local player = players.LocalPlayer
local connections = {}

local function disconnect_all()
    for _, connection in ipairs(connections) do
        connection:Disconnect()
    end

    table.clear(connections)
end

local function update_stamina()
    local character = player.Character
    if not character then
        return
    end

    character:SetAttribute("StaminaDisabled", true)

    local player_gui = player:FindFirstChildOfClass("PlayerGui")
    local core_hud = player_gui and player_gui:FindFirstChild("CoreHud")
    local player_info = core_hud and core_hud:FindFirstChild("PlayerInfo")
    local bars = player_info and player_info:FindFirstChild("Bars")
    local stamina = bars and bars:FindFirstChild("Stamina")

    if not stamina then
        return
    end

    local amount = stamina:FindFirstChild("Amount")
    if amount and amount:IsA("TextLabel") then
        amount.Text = "100/100"
    end

    local bar = stamina:FindFirstChild("Bar")
    local clipping = bar and bar:FindFirstChild("Clipping")

    if clipping then
        clipping.Size = UDim2.fromScale(1, 1)

        local top = clipping:FindFirstChild("Top")
        if top then
            top.Size = UDim2.fromScale(1, 1)
        end
    end
end

local function bind_character(character)
    disconnect_all()

    character:SetAttribute("StaminaDisabled", true)

    table.insert(connections, character.AttributeChanged:Connect(function(attribute)
        if attribute == "StaminaDisabled"
            and character:GetAttribute("StaminaDisabled") ~= true then
            character:SetAttribute("StaminaDisabled", true)
        end
    end))

    task.spawn(function()
        while character.Parent and player.Character == character do
            update_stamina()
            task.wait(0.1)
        end
    end)
end

if player.Character then
    bind_character(player.Character)
end

player.CharacterAdded:Connect(bind_character)
Executor compatibility changes over time. Check current reports before testing.

Script #11 Catsaken (Update )

Script #11 · CatsakenFree
Silent AimSilent AimbotAuto GenAuto GeneratorAuto FarmESP
loadstring(game:HttpGet('https://raw.githubusercontent.com/aibabylaugh/catsaken/refs/heads/main/Beta/catsaken.lua'))('gg/VzHp67sw9a')
Executor compatibility changes over time. Check current reports before testing.

Script #12 Hub

Script #12 · HubFree
🌐 Website: https://ttjy-studio.vercel.app🥳 Community Hub: https://ttjy-script.vercel.app/community🤝 Associations 🤝Authentication3https://ironbrew1.com/https://inject.today/
--[[
Please read the description above.
All Bugs & Suggestions go to Discord Forum.
All Tutorials are on YouTube and our official site.
--]]

loadstring(game:HttpGet("https://raw.githubusercontent.com/RealTTJY/Studio.Hub/refs/heads/main/APIs/M.lua"))();
Executor compatibility changes over time. Check current reports before testing.

Script #13 more & More

Script #13 · more & MoreFree
more
loadstring(game:HttpGet("https://raw.githubusercontent.com/Sariscute/scripts/refs/heads/main/forsaken%20%7C%20thegxx"))()
Executor compatibility changes over time. Check current reports before testing.

Script #14 Read this if you dont understand what it does: & More

Script #14 · Read this if you dont understand what it does: & MoreFree
Read this if you dont understand what it does:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LocalPlayer = game:GetService("Players").LocalPlayer

getgenv().ForsakenSpoof = {
	Enabled = true,
	MaxOffset = 4,
	PingDivisor = 1400,
}

local CharacterReplication = ReplicatedStorage:WaitForChild("Systems"):WaitForChild("Player"):WaitForChild("Game"):WaitForChild("CharacterReplication")
local module = require(CharacterReplication)

if not getgenv().OldSerialize then
	getgenv().OldSerialize = module.Serialize
end

function module.Serialize(p1, p2)
	if not getgenv().ForsakenSpoof.Enabled then
		return getgenv().OldSerialize(p1, p2)
	end

	local Character = LocalPlayer.Character
	local PrimaryPart

	if Character then
		PrimaryPart = Character.PrimaryPart
	else
		PrimaryPart = Character
	end

	if Character then
		Character = Character:FindFirstChildOfClass("Humanoid")
	end

	if not (PrimaryPart and (Character and (p1.Position - PrimaryPart.Position).Magnitude < 15)) then
		return getgenv().OldSerialize(p1, p2)
	end

	local MoveDirection = Character.MoveDirection

	if MoveDirection.Magnitude <= 0.1 then
		return getgenv().OldSerialize(p1, p2)
	end

	local Magnitude = PrimaryPart.AssemblyLinearVelocity.Magnitude
	local WalkSpeed = Character.WalkSpeed
	local v11 = math.max(Magnitude, WalkSpeed) * (LocalPlayer:GetNetworkPing() * 1000) / getgenv().ForsakenSpoof.PingDivisor
	local MaxOffset = getgenv().ForsakenSpoof.MaxOffset
	local v13 = math.min(v11, MaxOffset)
	local vector3 = Vector3.new(MoveDirection.X, 0, MoveDirection.Z)

	if vector3.Magnitude <= 0 then
		return getgenv().OldSerialize(p1, p2)
	end

	p1 = p1 + vector3.Unit * v13

	return getgenv().OldSerialize(p1, p2)
end
Executor compatibility changes over time. Check current reports before testing.

Script #15 TTJY Hub

Script #15 · TTJY HubFree
Infinite StaminaInf StaminaAuto GeneratorsGenerator FarmGhost ModeInvisible
loadstring(game:HttpGet("https://raw.githubusercontent.com/RealTTJY/Studio.Hub/refs/heads/main/APIs/M.lua"))();
Executor compatibility changes over time. Check current reports before testing.

Script #16 Executor That Doesnt Work With this script: & More

Script #16 · Executor That Doesnt Work With this script: & MoreFree
Executor That Doesnt Work With this script:XenoSolaraExecutor That Work with this scriptDeltaOther
loadstring(game:HttpGet("https://raw.githubusercontent.com/putrijelitaasia10-byte/forsakenaimation/refs/heads/main/animationcangr"))()
Executor compatibility changes over time. Check current reports before testing.

Script #17 Autofarm generators Auto kill Esp Aimbot & More

Script #17 · Autofarm generators Auto kill Esp Aimbot & MoreFree
Autofarm generators Auto kill Esp AimbotTeleportAuto Complete GeneratorsAuto itemsInstant Pick up
loadstring(game:HttpGet("https://pastebin.com/raw/eGMSjScC"))()
Executor compatibility changes over time. Check current reports before testing.

Script #18 auto generator(s) & More

Script #18 · auto generator(s) & MoreFree
auto generator(s)generator cooldowntp to generatorsrefresh generator listteleport to selected generatorauto block
loadstring(game:HttpGet("https://pastefy.app/zTT8OoVV/raw"))()
Executor compatibility changes over time. Check current reports before testing.

Script #19 features are garbage but it gets the job done & More (Kinda garbage tho Update)

Script #19 · features are garbage but it gets the job done & MoreFree
features are garbage but it gets the job done
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Lighting = game:GetService("Lighting")
local Workspace = game:GetService("Workspace")
local CoreGui = game:GetService("CoreGui")
local UserInputService = game:GetService("UserInputService")
local Stats = game:GetService("Stats")
local HttpService = game:GetService("HttpService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TextChatService = game:GetService("TextChatService")
local localPlayer = Players.LocalPlayer
local playerGui = localPlayer:WaitForChild("PlayerGui")

print("[testbraken] Loading v9.1.1...")

local WindUI = loadstring(game:HttpGet("https://github.com/Footagesus/WindUI/releases/latest/download/main.lua"))()

local config = {
  AntiBlindness = false,
  AntiGlitch = false,
  AntiSubspaced = false,
  AntiNoliLaugh = false,
  MinionESP = false,
  ProjectileESP = false,
  AzureTrapESP = false,
  AutoBlock = false,
  AutoBlockButton = false,
  ABMode = "Guest1337",
  AimPunch = false,
  FOVValue = 120,
  LowGraphics = false,
  MaxZoom = false,
  FPSPing = false,
  NoclipCam = false,
  ForceChat = false,
  Disable007n7 = false,
  ShowPrivacy = false,
  AutoBlockCustom = false,
  CustomABMode = "Guest1337",
  FourthButtonTarget = "default",
  CustomDiamondLength = 8,
  CustomDiamondWidth = 4,
  CustomDiamondOffset = 3,
  CustomCircleRadius = 5,
  ShowDiamond = false,
  ShowCircle = false,
  ZoneHeight = 0.5,
}

local toggles, sliders = {}, {}
local inputs = {}
local playerDropdown = nil
local suppressCallbacks = false
local rememberedZones = {diamond = false, circle = false}
local configFolder = "TestHub"
local configName = "default"

local function getConfigPath()
  return configFolder .. "/" .. configName .. ".json"
end

local function saveConfig()
  if not (writefile and isfolder and makefolder) then
    return false
  end
  pcall(function()
    if not isfolder(configFolder) then
      makefolder(configFolder)
    end
  end)
  return pcall(function()
    writefile(getConfigPath(), HttpService:JSONEncode(config))
  end)
end

local function loadConfig()
  if not (isfile and readfile and isfile(getConfigPath())) then
    return nil
  end
  local ok, decoded = pcall(function()
    return HttpService:JSONDecode(readfile(getConfigPath()))
  end)
  if ok and type(decoded) == "table" then
    return decoded
  end
  return nil
end

local function deleteConfig()
  if not (isfile and delfile) then
    return false
  end
  if isfile(getConfigPath()) then
    pcall(function()
      delfile(getConfigPath())
    end)
    return true
  end
  return false
end

local antiBlindnessState = {running = false, conn = nil}

local function startAntiBlindness()
  if antiBlindnessState.running then return end
  antiBlindnessState.running = true
  for _, child in ipairs(Lighting:GetChildren()) do
    if child:IsA("BlurEffect") then
      pcall(function()
        child:Destroy()
      end)
    end
  end
  antiBlindnessState.conn = Lighting.ChildAdded:Connect(function(child)
    if not antiBlindnessState.running then return end
    if child:IsA("BlurEffect") then
      pcall(function()
        child:Destroy()
      end)
    end
  end)
end

local function stopAntiBlindness()
  antiBlindnessState.running = false
  if antiBlindnessState.conn then
    antiBlindnessState.conn:Disconnect()
    antiBlindnessState.conn = nil
  end
end

local antiGlitchState = {running = false, connections = {}}

local function startAntiGlitch()
  if antiGlitchState.running then return end
  antiGlitchState.running = true
  local glitchNames = {Glitched = true, Hallucination = true}

  local function isGlitchElement(instance)
    if not instance or not glitchNames[instance.Name] then
      return false
    end
    local mainUI = playerGui:FindFirstChild("MainUI")
    local temporaryUI = playerGui:FindFirstChild("TemporaryUI")
    if mainUI then
      local statusContainer = mainUI:FindFirstChild("StatusContainer")
      if statusContainer and instance:IsDescendantOf(statusContainer) then
        return true
      end
    end
    if temporaryUI and instance:IsDescendantOf(temporaryUI) then
      return true
    end
    return false
  end

  local function handleInstance(instance)
    if not instance or not instance.Parent then return end
    if isGlitchElement(instance) then
      pcall(function()
        instance:Destroy()
      end)
    elseif instance:IsA("Frame") then
      local temporaryUI = playerGui:FindFirstChild("TemporaryUI")
      if temporaryUI then
        local frame = temporaryUI:FindFirstChild("Frame")
        if frame and instance:IsDescendantOf(frame) then
          pcall(function()
            instance:Destroy()
          end)
        end
      end
    end
  end

  local function watchRoot(root)
    if not root then return end
    table.insert(antiGlitchState.connections, root.DescendantAdded:Connect(handleInstance))
    for _, descendant in ipairs(root:GetDescendants()) do
      handleInstance(descendant)
    end
  end

  watchRoot(playerGui)
end

local function stopAntiGlitch()
  antiGlitchState.running = false
  for _, connection in ipairs(antiGlitchState.connections) do
    pcall(function()
      connection:Disconnect()
    end)
  end
  antiGlitchState.connections = {}
end

local antiSubspacedState = {running = false, connections = {}}

local function startAntiSubspaced()
  if antiSubspacedState.running then return end
  antiSubspacedState.running = true
  local lightingEffectNames = {
    SubspaceVFXBlur = true,
    SubspaceVFXColorCorrection = true,
    HealthDesaturation = true,
  }
  local uiEffectNames = {Subspaced = true}

  local function isLightingEffect(instance)
    return lightingEffectNames[instance.Name] and instance:IsDescendantOf(Lighting)
  end

  local function isUiEffect(instance)
    if not uiEffectNames[instance.Name] then
      return false
    end
    local mainUI = playerGui:FindFirstChild("MainUI")
    local temporaryUI = playerGui:FindFirstChild("TemporaryUI")
    if mainUI then
      local statusContainer = mainUI:FindFirstChild("StatusContainer")
      if statusContainer and instance:IsDescendantOf(statusContainer) then
        return true
      end
    end
    if temporaryUI and instance:IsDescendantOf(temporaryUI) then
      return true
    end
    return false
  end

  local function handleInstance(instance)
    if not instance or not instance.Parent then return end
    if isLightingEffect(instance) or isUiEffect(instance) then
      pcall(function()
        instance:Destroy()
      end)
    end
  end

  local function watchRoot(root)
    if not root then return end
    table.insert(antiSubspacedState.connections, root.DescendantAdded:Connect(handleInstance))
    for _, descendant in ipairs(root:GetDescendants()) do
      handleInstance(descendant)
    end
  end

  watchRoot(Lighting)
  watchRoot(playerGui)
end

local function stopAntiSubspaced()
  antiSubspacedState.running = false
  for _, connection in ipairs(antiSubspacedState.connections) do
    pcall(function()
      connection:Disconnect()
    end)
  end
  antiSubspacedState.connections = {}
end

local antiNoliLaughState = {running = false, connections = {}}

local function startAntiNoliLaugh()
  if antiNoliLaughState.running then return end
  antiNoliLaughState.running = true

  local function isNoliLaugh(instance)
    if not instance or instance.Name ~= "noliLaugh" then
      return false
    end
    local camera = Workspace.CurrentCamera
    return camera and (instance:IsDescendantOf(camera) or instance:IsDescendantOf(Workspace))
  end

  local function handleInstance(instance)
    if not instance or not instance.Parent then return end
    if isNoliLaugh(instance) then
      pcall(function()
        instance:Destroy()
      end)
    end
  end

  local function watchRoot(root)
    if not root then return end
    table.insert(antiNoliLaughState.connections, root.DescendantAdded:Connect(handleInstance))
    for _, descendant in ipairs(root:GetDescendants()) do
      handleInstance(descendant)
    end
  end

  watchRoot(Workspace.CurrentCamera)
  table.insert(antiNoliLaughState.connections, Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
    watchRoot(Workspace.CurrentCamera)
  end))
  local existingCamera = Workspace:FindFirstChild("Camera")
  if existingCamera then
    watchRoot(existingCamera)
  end
  table.insert(antiNoliLaughState.connections, Workspace.ChildAdded:Connect(function(child)
    if child.Name == "Camera" then
      watchRoot(child)
    end
  end))
end

local function stopAntiNoliLaugh()
  antiNoliLaughState.running = false
  for _, connection in ipairs(antiNoliLaughState.connections) do
    pcall(function()
      connection:Disconnect()
    end)
  end
  antiNoliLaughState.connections = {}
end

local minionEspState = {running = false, connections = {}, folder = nil}
local characterOwnersWeak = setmetatable({}, {__mode = "k"})
local characterOwners = {}

local function trackPlayer(player)
  if player.Character then
    characterOwnersWeak[player.Character] = player
    characterOwners[player.Character] = player
  end
  player.CharacterAdded:Connect(function(character)
    characterOwnersWeak[character] = player
    characterOwners[character] = player
    task.wait(0.1)
    if minionEspState.folder then
      local existing = minionEspState.folder:FindFirstChild(character:GetDebugId())
      if existing then
        existing:Destroy()
      end
    end
  end)
end

for _, player in ipairs(Players:GetPlayers()) do
  trackPlayer(player)
end
Players.PlayerAdded:Connect(trackPlayer)
Players.PlayerRemoving:Connect(function(player)
  if player.Character then
    characterOwnersWeak[player.Character] = nil
    characterOwners[player.Character] = nil
  end
end)

local minionExcludedNames = {
  "primordial", "betrayed", "classic", "crew leader", "evil green skeleton",
  "soccer legend", "green guest", "toy", "16th night", "pride", "green envy",
  "darkness", "infernum", "monochrome", "illumina", "bluesteel", "everfrost",
  "fleskhjerta", "voidbound", "timeless", "toon", "xx4ce0fspadesxx", "ace",
  "milestone zero", "milestone i", "milestone ii", "milestone iii", "milestone iv",
  "milestone", "guardian", "hacklord", "erlking", "crazyblox", "martyr",
  "eye of the abyss", "savior", "scarletkidd", "guide shedletsky", "shedletsky",
  "jack frost", "eggs", "champion", "big 1x1x1x1", "big 1x1",
}

local function startMinionEsp()
  if minionEspState.running then return end
  minionEspState.running = true

  local highlightFolder = Instance.new("Folder")
  highlightFolder.Name = "MinionESP_Highlights"
  highlightFolder.Parent = CoreGui
  minionEspState.folder = highlightFolder

  local keywordNames = {
    "killer", "kidd", "1x1x1x1", "c00lkidd", "c00lkid", "jane", "doe", "jane_doe",
    "janedoe", "lobby", "ambient", "decor", "prop", "dummy", "statue", "mannequin",
    "display", "preview", "shop", "corpse", "dead", "ragdoll", "body", "bone", "npc",
    "character",
  }
  local ambientAncestorNames = {
    "lobby", "menu", "npc", "ambient", "decor", "characters", "preview", "display",
    "shop", "spawn_area",
  }
  local minionAncestorNames = {"minion", "enem", "summon", "spawned", "mob", "rotten"}

  local function nameMatchesList(name, list)
    local lowered = string.lower(name)
    for _, keyword in ipairs(list) do
      if string.find(lowered, keyword, 1, true) then
        return true
      end
    end
    return false
  end

  local function isExcludedName(name)
    local lowered = string.lower(name)
    for _, excluded in ipairs(minionExcludedNames) do
      if lowered == excluded or string.find(lowered, excluded, 1, true) then
        return true
      end
    end
    return false
  end

  local function selfOrAncestorIsExcludedName(instance)
    local current, depth = instance, 0
    while current and depth < 5 do
      if isExcludedName(current.Name) then
        return true
      end
      current, depth = current.Parent, depth + 1
    end
    return false
  end

  local function selfOrAncestorHasKeyword(instance)
    local current, depth = instance, 0
    while current and depth < 5 do
      if nameMatchesList(current.Name, keywordNames) then
        return true
      end
      current, depth = current.Parent, depth + 1
    end
    return false
  end

  local function ancestorIsAmbient(instance)
    local current, depth = instance.Parent, 0
    while current and depth < 5 do
      if nameMatchesList(current.Name, ambientAncestorNames) then
        return true
      end
      current, depth = current.Parent, depth + 1
    end
    return false
  end

  local function ancestorIsMinionGroup(instance)
    local current, depth = instance.Parent, 0
    while current and depth < 5 do
      if nameMatchesList(current.Name, minionAncestorNames) then
        return true
      end
      current, depth = current.Parent, depth + 1
    end
    return false
  end

  local function isPlayerCharacter(model)
    if characterOwnersWeak[model] or characterOwners[model] then
      return true
    end
    local ok, owner = pcall(function()
      return Players:GetPlayerFromCharacter(model)
    end)
    if ok and owner then
      return true
    end
    for character in pairs(characterOwners) do
      if character and character.Parent then
        if model == character then
          return true
        end
        local okDescendant, isDescendant = pcall(function()
          return model:IsDescendantOf(character)
        end)
        if okDescendant and isDescendant then
          return true
        end
      else
        characterOwners[character] = nil
      end
    end
    local current, depth = model, 0
    while current and depth < 10 do
      if current:IsA("Player") then
        return true
      end
      current, depth = current.Parent, depth + 1
    end
    return false
  end

  local function isMinionModel(model)
    if not model:IsA("Model") then return false end
    if isPlayerCharacter(model) then return false end
    local hasExcludedName = selfOrAncestorIsExcludedName(model)
    if not hasExcludedName and selfOrAncestorHasKeyword(model) then return false end
    if ancestorIsAmbient(model) then return false end
    local inMinionGroup = ancestorIsMinionGroup(model)
    local humanoid = model:FindFirstChildOfClass("Humanoid")
    if not humanoid or humanoid.Health <= 0 or humanoid:GetState() == Enum.HumanoidStateType.Dead then
      return false
    end
    local rootPart = model:FindFirstChild("HumanoidRootPart")
      or model:FindFirstChild("Torso")
      or model:FindFirstChild("UpperTorso")
      or model:FindFirstChild("Head")
    if not rootPart then return false end
    local anchoredCount, partCount = 0, 0
    for _, child in ipairs(model:GetChildren()) do
      if child:IsA("BasePart") then
        partCount = partCount + 1
        if child.Anchored then
          anchoredCount = anchoredCount + 1
        end
      end
    end
    if partCount > 0 and anchoredCount == partCount then return false end
    if not inMinionGroup and not hasExcludedName and rootPart.Anchored then return false end
    return true
  end

  local function createMinionHighlight(model)
    if not model or not model:IsA("Model") or isPlayerCharacter(model) then return end
    local key = model:GetDebugId()
    if highlightFolder:FindFirstChild(key) then return end
    local highlight = Instance.new("Highlight")
    highlight.Name = key
    highlight.Adornee = model
    highlight.FillTransparency = 0.5
    highlight.FillColor = Color3.fromRGB(255, 255, 0)
    highlight.OutlineColor = Color3.fromRGB(255, 255, 0)
    highlight.OutlineTransparency = 0
    highlight.Parent = highlightFolder
    model.Destroying:Connect(function()
      if highlight then
        highlight:Destroy()
      end
    end)
    task.delay(0.3, function()
      if highlight and highlight.Parent and isPlayerCharacter(model) then
        highlight:Destroy()
      end
    end)
  end

  local function considerInstance(instance)
    if minionEspState.running and isMinionModel(instance) then
      createMinionHighlight(instance)
    end
  end

  for _, descendant in ipairs(Workspace:GetDescendants()) do
    considerInstance(descendant)
  end
  table.insert(minionEspState.connections, Workspace.DescendantAdded:Connect(function(descendant)
    task.wait(0.1)
    considerInstance(descendant)
  end))
end

local function stopMinionEsp()
  minionEspState.running = false
  for _, connection in ipairs(minionEspState.connections) do
    pcall(function()
      connection:Disconnect()
    end)
  end
  minionEspState.connections = {}
  if minionEspState.folder then
    pcall(function()
      minionEspState.folder:Destroy()
    end)
    minionEspState.folder = nil
  end
end

local projectileEspState = {running = false, connections = {}, folder = nil}

local function startProjectileEsp()
  if projectileEspState.running then return end
  projectileEspState.running = true

  local highlightFolder = Instance.new("Folder")
  highlightFolder.Name = "ProjectileESP_Highlights"
  highlightFolder.Parent = Workspace
  projectileEspState.folder = highlightFolder

  local projectileColor = Color3.fromRGB(255, 50, 50)
  local projectileNames = {HumanoidRootProjectile = true}
  local ignoredAncestorNames = {"lobby", "spawn", "menu", "waitingroom", "decor", "ambient"}
  local trackedParts = setmetatable({}, {__mode = "k"})
  local highlightsByPart = setmetatable({}, {__mode = "k"})

  local function belongsToCharacter(instance)
    for _, player in ipairs(Players:GetPlayers()) do
      local character = player.Character
      if character and instance:IsDescendantOf(character) then
        return true
      end
    end
    local model = instance:FindFirstAncestorOfClass("Model")
    if model and model:FindFirstChildOfClass("Humanoid") then
      return true
    end
    return false
  end

  local function isInIgnoredArea(instance)
    local current = instance.Parent
    while current and current ~= Workspace do
      local lowered = current.Name:lower()
      for _, ignored in ipairs(ignoredAncestorNames) do
        if lowered:find(ignored) then
          return true
        end
      end
      current = current.Parent
    end
    return false
  end

  local function addHighlight(part)
    if not projectileEspState.running or not part or not part.Parent or trackedParts[part] then return end
    local highlight = Instance.new("Highlight")
    highlight.Name = "ProjESPHL"
    highlight.Adornee = part
    highlight.FillColor = projectileColor
    highlight.FillTransparency = 0.35
    highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
    highlight.OutlineTransparency = 0
    highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
    highlight.Parent = highlightFolder
    trackedParts[part] = true
    highlightsByPart[part] = highlight
    part.AncestryChanged:Connect(function(_, newParent)
      if not newParent then
        trackedParts[part] = nil
        if highlight and highlight.Parent then
          highlight:Destroy()
        end
        highlightsByPart[part] = nil
      end
    end)
  end

  local function considerInstance(instance)
    if not projectileEspState.running or not instance or not instance.Parent
      or belongsToCharacter(instance) or isInIgnoredArea(instance) then
      return
    end
    if projectileNames[instance.Name] and instance:IsA("BasePart") then
      local fullName = instance:GetFullName()
      if fullName:find("Map.Ingame", 1, true) then
        addHighlight(instance)
      end
    end
  end

  table.insert(projectileEspState.connections, Workspace.DescendantAdded:Connect(function(descendant)
    if not projectileEspState.running then return end
    if descendant:IsA("BasePart") or descendant:IsA("Model") then
      considerInstance(descendant)
    end
  end))

  task.spawn(function()
    local processed = 0
    for _, descendant in ipairs(Workspace:GetDescendants()) do
      if not projectileEspState.running then break end
      if descendant:IsA("BasePart") or descendant:IsA("Model") then
        considerInstance(descendant)
        processed = processed + 1
        if processed % 250 == 0 then
          task.wait()
        end
      end
    end
  end)
end

local function stopProjectileEsp()
  projectileEspState.running = false
  for _, connection in ipairs(projectileEspState.connections) do
    pcall(function()
      connection:Disconnect()
    end)
  end
  projectileEspState.connections = {}
  if projectileEspState.folder then
    pcall(function()
      projectileEspState.folder:Destroy()
    end)
    projectileEspState.folder = nil
  end
end

local azureTrapEspState = {running = false, connections = {}, folder = nil}

local function startAzureTrapEsp()
  if azureTrapEspState.running then return end
  azureTrapEspState.running = true

  local highlightFolder = Instance.new("Folder")
  highlightFolder.Name = "AzureTrapESP_Folder"
  highlightFolder.Parent = Workspace
  azureTrapEspState.folder = highlightFolder

  local trapColor = Color3.fromRGB(160, 32, 240)
  local maxSameNameCount, recentWindowSeconds, pollInterval = 6, 5, 0.3

  local trapPartNames = {
    Flower_Base = true,
    Flower_Bottom = true,
    Flower_Root = true,
    Flower_Tentacle = true,
    Flower_Top = true,
    Nectar = true,
    Root1 = true,
    Root2 = true,
    Root3 = true,
    Root4 = true,
    Tendril_Middle = true,
    Tentacle = true,
    ["Tentacle42.001"] = true,
    Tentacle_Base = true,
    GroundBulb = true,
    Vine = true,
  }
  local ignoredAncestorNames = {"lobby", "spawn", "menu", "waitingroom", "decor", "ambient"}

  local highlightByPart, highlightedParts, recentParts = {}, {}, {}
  local nameCounts, floodedNames, countedParts = {}, {}, {}

  local function belongsToCharacter(instance)
    for _, player in ipairs(Players:GetPlayers()) do
      local character = player.Character
      if character and instance:IsDescendantOf(character) then
        return true
      end
    end
    local model = instance:FindFirstAncestorOfClass("Model")
    return model and model:FindFirstChildOfClass("Humanoid")
  end

  local function isInIgnoredArea(instance)
    local current = instance.Parent
    while current and current ~= Workspace do
      local lowered = current.Name:lower()
      for _, ignored in ipairs(ignoredAncestorNames) do
        if lowered:find(ignored) then
          return true
        end
      end
      current = current.Parent
    end
    return false
  end

  local function isTargetPart(part)
    return trapPartNames[part.Name] and not floodedNames[part.Name]
  end

  local function removeHighlightsByName(name)
    for part, highlight in pairs(highlightByPart) do
      if part.Name == name then
        if highlight and highlight.Parent then
          highlight:Destroy()
        end
        highlightByPart[part] = nil
        highlightedParts[part] = nil
      end
    end
  end

  local function countPart(part)
    if countedParts[part] or not trapPartNames[part.Name] then return end
    countedParts[part] = true
    nameCounts[part.Name] = (nameCounts[part.Name] or 0) + 1
    if nameCounts[part.Name] > maxSameNameCount and not floodedNames[part.Name] then
      floodedNames[part.Name] = true
      removeHighlightsByName(part.Name)
    end
  end

  local function uncountPart(part)
    if not countedParts[part] then return end
    countedParts[part] = nil
    local name = part.Name
    if not nameCounts[name] then return end
    nameCounts[name] = math.max(0, nameCounts[name] - 1)
    if nameCounts[name] <= maxSameNameCount and floodedNames[name] then
      floodedNames[name] = nil
    end
  end

  local function cleanupPart(part)
    uncountPart(part)
    highlightedParts[part] = nil
    recentParts[part] = nil
    if highlightByPart[part] then
      if highlightByPart[part].Parent then
        highlightByPart[part]:Destroy()
      end
      highlightByPart[part] = nil
    end
  end

  local function createHighlight(part)
    if highlightedParts[part] then return end
    if highlightByPart[part] then
      highlightedParts[part] = true
      return
    end
    local highlight = Instance.new("Highlight")
    highlight.Name = "AzureTrapHL"
    highlight.Adornee = part
    highlight.FillColor = trapColor
    highlight.FillTransparency = 0.75
    highlight.OutlineColor = trapColor
    highlight.OutlineTransparency = 0
    highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
    highlight.Parent = highlightFolder
    highlightByPart[part] = highlight
    highlightedParts[part] = true
  end

  local function considerPart(part)
    if not azureTrapEspState.running or not part:IsA("BasePart") then return end
    if highlightedParts[part] or belongsToCharacter(part) or isInIgnoredArea(part) then return end
    if not isTargetPart(part) then return end
    if not part:GetAttribute("AzureESP_Hooked") then
      part:SetAttribute("AzureESP_Hooked", true)
      part.AncestryChanged:Connect(function(_, newParent)
        if not newParent then
          cleanupPart(part)
        end
      end)
    end
    createHighlight(part)
  end

  for _, descendant in ipairs(Workspace:GetDescendants()) do
    if descendant:IsA("BasePart") and trapPartNames[descendant.Name] then
      countedParts[descendant] = true
      nameCounts[descendant.Name] = (nameCounts[descendant.Name] or 0) + 1
    end
  end
  for name, count in pairs(nameCounts) do
    if count > maxSameNameCount then
      floodedNames[name] = true
    end
  end
  for _, descendant in ipairs(Workspace:GetDescendants()) do
    if descendant:IsA("BasePart") then
      considerPart(descendant)
    end
  end

  table.insert(azureTrapEspState.connections, Workspace.DescendantAdded:Connect(function(descendant)
    if not descendant:IsA("BasePart") then return end
    countPart(descendant)
    recentParts[descendant] = tick()
    considerPart(descendant)
  end))

  task.spawn(function()
    while azureTrapEspState.running do
      task.wait(pollInterval)
      local now = tick()
      for part, addedAt in pairs(recentParts) do
        if not part.Parent then
          recentParts[part] = nil
        elseif now - addedAt > recentWindowSeconds then
          recentParts[part] = nil
        elseif not highlightedParts[part] then
          considerPart(part)
        end
      end
    end
  end)
end

local function stopAzureTrapEsp()
  azureTrapEspState.running = false
  for _, connection in ipairs(azureTrapEspState.connections) do
    pcall(function()
      connection:Disconnect()
    end)
  end
  azureTrapEspState.connections = {}
  if azureTrapEspState.folder then
    pcall(function()
      azureTrapEspState.folder:Destroy()
    end)
    azureTrapEspState.folder = nil
  end
end

local forceChatState = {running = false}

local function startForceChat()
  if forceChatState.running then return end
  forceChatState.running = true
  task.spawn(function()
    while forceChatState.running do
      task.wait(0.5)
      pcall(function()
        local chatWindow = TextChatService:FindFirstChildOfClass("ChatWindowConfiguration")
        if chatWindow then
          chatWindow.Enabled = true
        end
      end)
    end
  end)
end

local function stopForceChat()
  forceChatState.running = false
end

local disableCloneState = {running = false, moved = {}}

local function startDisableClone()
  if disableCloneState.running then return end
  disableCloneState.running = true
  disableCloneState.moved = {}
  task.spawn(function()
    while disableCloneState.running do
      task.wait(0.5)
      local ingame = Workspace:FindFirstChild("Map") and Workspace.Map:FindFirstChild("Ingame")
      if ingame then
        for _, child in ipairs(ingame:GetChildren()) do
          if child.Name:lower() == "007n7" and not Players:GetPlayerFromCharacter(child) then
            local originalParent = child.Parent
            if pcall(function()
              child.Parent = Lighting
            end) then
              disableCloneState.moved[child] = originalParent
            end
          end
        end
      end
    end
  end)
end

local function stopDisableClone()
  disableCloneState.running = false
  for instance, originalParent in pairs(disableCloneState.moved) do
    if instance and instance.Parent == Lighting and originalParent and originalParent.Parent then
      pcall(function()
        instance.Parent = originalParent
      end)
    end
  end
  table.clear(disableCloneState.moved)
end

local showPrivacyState = {running = false}

local function startShowPrivacy()
  if showPrivacyState.running then return end
  showPrivacyState.running = true
  task.spawn(function()
    while showPrivacyState.running do
      task.wait(0.5)
      for _, player in ipairs(Players:GetPlayers()) do
        if player ~= localPlayer then
          local playerData = player:FindFirstChild("PlayerData")
          local privacyFolder = playerData and playerData:FindFirstChild("Privacy", true)
          if privacyFolder then
            for _, setting in ipairs(privacyFolder:GetChildren()) do
              if setting:IsA("BoolValue") then
                pcall(function()
                  setting.Value = false
                end)
              end
            end
          end
        end
      end
    end
  end)
end

local function stopShowPrivacy()
  showPrivacyState.running = false
end

local autoBlockState = {
  running = false,
  connections = {},
  attrStates = {},
  attrDebounce = 0,
  blueDebounce = 0,
  punchDebounce = 0,
  generation = 0,
  RemoteEvent = nil,
  KillersFolder = nil,
  LocalRoot = nil,
}

local startAutoBlock, stopAutoBlock

local fourthButtonState = {
  instance = nil,
  applyTint = nil,
  running = false,
  connections = {},
  cachedPos = nil,
  cachedSize = nil,
  sourceName = nil,
}

local lastToggleTime = 0
local pendingToggle = nil
local pendingToggleTask = nil
local toggleDebounce = 0.08

do
  local modules = ReplicatedStorage:FindFirstChild("Modules")
  local outerNetwork = modules and modules:FindFirstChild("Network", true)
  local innerNetwork = outerNetwork and outerNetwork:FindFirstChild("Network", true)
  autoBlockState.RemoteEvent = innerNetwork and innerNetwork:FindFirstChild("RemoteEvent")
  if not autoBlockState.RemoteEvent then
    autoBlockState.RemoteEvent = ReplicatedStorage:FindFirstChild("RemoteEvent", true)
  end
end

local function getPingSeconds()
  local ping = 0.05
  pcall(function()
    local network = Stats:FindFirstChild("Network")
    local serverStatsItem = network and network:FindFirstChild("ServerStatsItem")
    local dataPing = serverStatsItem and serverStatsItem:FindFirstChild("Data Ping")
    if dataPing then
      ping = dataPing:GetValue() / 1000
    end
  end)
  return math.clamp(ping, 0.05, 0.35)
end

local blockSoundIdList = {
  "102228729296384", "140242176732868", "112809109188560", "136323728355613",
  "115026634746636", "84116622032112", "108907358619313", "127793641088496",
  "86174610237192", "95079963655241", "101199185291628", "119942598489800",
  "84307400688050", "113037804008732", "105200830849301", "75330693422988",
  "82221759983649", "81702359653578", "108610718831698", "112395455254818",
  "109431876587852", "109348678063422", "85853080745515", "98733709078792",
  "105840448036441", "114742322778642", "119583605486352", "79980897195554",
  "71805956520207", "79391273191671", "89004992452376", "101553872555606",
  "101698569375359", "105415540898010", "106300477136129", "80516583309685",
  "116581754553533", "117231507259853", "119089145505438", "71834552297085",
  "117173212095661", "104910828105172", "140412278320643", "85544168523099",
  "114506382930939", "116527305931161", "131406927389838", "94317217837143",
  "121954639447247", "125213046326879", "128856426573270", "128195973631079",
  "124903763333174", "98111231282218", "136728245733659", "131123355704017",
  "107444859834748", "76959687420003", "72425554233832", "96594507550917",
  "139996647355899", "107345261604889", "127557531826290", "108651070773439",
  "74842815979546", "124397369810639", "76467993976301", "118493324723683",
  "78298577002481", "5148302439", "98675142200448", "128367348686124",
  "103684883268194", "109246041199659", "80540530406270", "139523195429581",
  "105204810054381", "116468089135195", "133709029886490", "124234993291213",
  "99856718263455", "74809026448465", "86833981571073", "110372418055226",
  "86494585504534", "99829427721752", "120059928759346", "104625283622511",
  "105316545074913", "126131675979001", "82336352305186", "93366464803829",
  "84069821282466",
}

local blockSoundIds = {}
for _, soundId in ipairs(blockSoundIdList) do
  blockSoundIds["rbxassetid://" .. soundId] = true
  blockSoundIds[soundId] = true
end

local punchSoundIdList = {
  "132298811847315", "81114852524420", "123825742002486", "116616310968045",
  "102808968188291", "117828699507982", "125854302746190", "18568553101",
  "95135835034592", "135209101640984", "91165993312513", "82772022662025",
}

local punchSoundIds = {}
for _, soundId in ipairs(punchSoundIdList) do
  punchSoundIds["rbxassetid://" .. soundId] = true
end

local function isPunchSound(soundId)
  if not soundId or soundId == "" then return false end
  if punchSoundIds[soundId] then return true end
  local numericId = soundId:match("rbxassetid://(%d+)") or soundId:match("^(%d+)$")
  return numericId and punchSoundIds["rbxassetid://" .. numericId] or false
end

local function fireAbility(abilityName)
  if autoBlockState.RemoteEvent then
    pcall(function()
      autoBlockState.RemoteEvent:FireServer("UseActorAbility", {abilityName})
    end)
  end
end

local function fireBlock()
  fireAbility("Block")
end

local function fireClone()
  fireAbility("Clone")
end

local function getActiveBlockMode()
  if config.AutoBlockCustom then
    return config.CustomABMode
  end
  return config.ABMode
end

local function performBlock()
  if getActiveBlockMode() == "007n7" then
    fireClone()
  else
    fireBlock()
  end
end

local function getNearestKiller()
  local killersFolder = autoBlockState.KillersFolder
  if not killersFolder or not killersFolder.Parent then
    local playersFolder = Workspace:FindFirstChild("Players")
    killersFolder = playersFolder and playersFolder:FindFirstChild("Killers")
  end
  local localRoot = autoBlockState.LocalRoot
  if not localRoot or not localRoot.Parent then
    local character = localPlayer.Character
    localRoot = character and character:FindFirstChild("HumanoidRootPart")
  end
  if not killersFolder or not localRoot then
    return nil, nil
  end
  local nearestRoot, nearestModel, nearestDistance = nil, nil, 30
  for _, killer in pairs(killersFolder:GetChildren()) do
    local killerRoot = killer:FindFirstChild("HumanoidRootPart")
    if killerRoot then
      local distance = (localRoot.Position - killerRoot.Position).Magnitude
      if distance < nearestDistance then
        nearestDistance = distance
        nearestRoot = killerRoot
        nearestModel = killer
      end
    end
  end
  return nearestRoot, nearestModel
end

local function aimAtKiller()
  local killerRoot, killerModel = getNearestKiller()
  if not (killerRoot and autoBlockState.LocalRoot and killerModel) then return end
  local killerHumanoid = killerModel:FindFirstChildOfClass("Humanoid")
  local startTime = tick()
  local lastKillerPosition = killerRoot.Position
  local connection
  connection = RunService.RenderStepped:Connect(function(deltaTime)
    if not autoBlockState.running or tick() - startTime > 0.6 or not autoBlockState.LocalRoot or not killerRoot then
      connection:Disconnect()
      return
    end
    local myPosition = autoBlockState.LocalRoot.Position
    local killerPosition = killerRoot.Position
    local velocity = (killerPosition - lastKillerPosition) / math.max(deltaTime, 0.001)
    lastKillerPosition = killerPosition
    local moveDirection = killerHumanoid and killerHumanoid.MoveDirection or Vector3.new()
    local walkSpeed = killerHumanoid and killerHumanoid.WalkSpeed or 16
    local leadTime = 0.24 + getPingSeconds()
    local predictedPosition = killerPosition
      + moveDirection * walkSpeed * leadTime
      + Vector3.new(velocity.X, 0, velocity.Z) * 0.08
    autoBlockState.LocalRoot.CFrame = CFrame.lookAt(
      myPosition,
      Vector3.new(predictedPosition.X, myPosition.Y, predictedPosition.Z)
    )
  end)
end

local function aimAndPunch()
  if not autoBlockState.running or not config.AimPunch then return end
  if getActiveBlockMode() == "007n7" then return end
  local now = tick()
  if now - autoBlockState.punchDebounce < 0.2 then return end
  autoBlockState.punchDebounce = now
  task.spawn(function()
    aimAtKiller()
    fireAbility("Punch")
  end)
end

local function watchPunchSounds(character)
  if not character then return end
  local function checkSound(instance)
    if instance:IsA("Sound") and isPunchSound(instance.SoundId) then
      aimAndPunch()
    end
  end
  for _, descendant in pairs(character:GetDescendants()) do
    checkSound(descendant)
  end
  table.insert(autoBlockState.connections, character.DescendantAdded:Connect(checkSound))
end

local customZoneState = {running = false, connections = {}, folder = nil, killerZones = {}}
local zonePadding = 1.5

local function getZoneCFrame(killerRoot)
  local raycastParams = RaycastParams.new()
  raycastParams.FilterType = Enum.RaycastFilterType.Exclude
  raycastParams.FilterDescendantsInstances = {killerRoot.Parent, localPlayer.Character}
  raycastParams.IgnoreWater = true
  local result = Workspace:Raycast(killerRoot.Position, Vector3.new(0, -30, 0), raycastParams)
  local groundY = result and (killerRoot.Position.Y - result.Distance) or (killerRoot.Position.Y - 3)
  return CFrame.new(killerRoot.Position.X, groundY + (config.ZoneHeight or 0.5), killerRoot.Position.Z)
    * killerRoot.CFrame.Rotation
end

local function createZoneVisuals(killer)
  local zoneModel = Instance.new("Model")
  zoneModel.Name = "ABCustomZone_" .. killer.Name
  zoneModel.Parent = customZoneState.folder
  local edges = {}
  for index = 1, 4 do
    local edge = Instance.new("Part")
    edge.Name = "Edge" .. index
    edge.Anchored = true
    edge.CanCollide = false
    edge.CanQuery = false
    edge.CanTouch = false
    edge.CastShadow = false
    edge.Material = Enum.Material.Neon
    edge.Color = Color3.fromRGB(255, 0, 0)
    edge.Transparency = 0.3
    edge.Size = Vector3.new(0.35, 0.08, 1)
    edge.CFrame = CFrame.new(0, -5000, 0)
    edge.Parent = zoneModel
    edges[index] = edge
  end
  local circle = Instance.new("Part")
  circle.Shape = Enum.PartType.Cylinder
  circle.Name = "Circle"
  circle.Anchored = true
  circle.CanCollide = false
  circle.CanQuery = false
  circle.CanTouch = false
  circle.CastShadow = false
  circle.Material = Enum.Material.Neon
  circle.Color = Color3.fromRGB(255, 0, 0)
  circle.Transparency = 0.65
  circle.Size = Vector3.new(0.08, 10, 10)
  circle.CFrame = CFrame.new(0, -5000, 0)
  circle.Parent = zoneModel
  return {model = zoneModel, edges = edges, circle = circle, killer = killer}
end

local function isInsideDiamond(position, killerCFrame, killerPosition)
  if not config.ShowDiamond then return false end
  local lookVector = killerCFrame.LookVector
  local rightVector = killerCFrame.RightVector
  local forward = Vector3.new(lookVector.X, 0, lookVector.Z)
  local right = Vector3.new(rightVector.X, 0, rightVector.Z)
  if forward.Magnitude < 0.01 or right.Magnitude < 0.01 then return false end
  forward = forward.Unit
  right = right.Unit
  local offset = Vector3.new(position.X - killerPosition.X, 0, position.Z - killerPosition.Z)
  local forwardDistance = offset:Dot(forward)
  local rightDistance = offset:Dot(right)
  local diamondCenter = config.CustomDiamondOffset + config.CustomDiamondLength / 2
  local forwardFromCenter = forwardDistance - diamondCenter
  local halfWidth = config.CustomDiamondWidth / 2 + zonePadding
  local halfLength = config.CustomDiamondLength / 2 + zonePadding
  return math.abs(rightDistance) / halfWidth + math.abs(forwardFromCenter) / halfLength <= 1
end

local function isInsideCircle(position, center)
  if not config.ShowCircle then return false end
  local dx = position.X - center.X
  local dz = position.Z - center.Z
  local radius = config.CustomCircleRadius + zonePadding
  return dx * dx + dz * dz <= radius * radius
end

local function isLocalPlayerInZone(killer)
  if not killer or not killer.Parent then return false end
  local killerRoot = killer:FindFirstChild("HumanoidRootPart")
  local character = localPlayer.Character
  local localRoot = character and character:FindFirstChild("HumanoidRootPart")
  if not killerRoot or not localRoot then return false end
  return isInsideDiamond(localRoot.Position, killerRoot.CFrame, killerRoot.Position)
    or isInsideCircle(localRoot.Position, killerRoot.Position)
end

local function updateZoneVisuals(visuals, killerRoot, localRoot)
  if not visuals or not visuals.model or not visuals.model.Parent then return end
  if not killerRoot or not killerRoot.Parent then return end
  local zoneCFrame = getZoneCFrame(killerRoot)
  local faceOffset = config.CustomDiamondOffset
  local diamondLength = config.CustomDiamondLength
  local diamondWidth = config.CustomDiamondWidth
  local nearPoint = zoneCFrame:PointToWorldSpace(Vector3.new(0, 0, -faceOffset))
  local farPoint = zoneCFrame:PointToWorldSpace(Vector3.new(0, 0, -(faceOffset + diamondLength)))
  local leftPoint = zoneCFrame:PointToWorldSpace(Vector3.new(-diamondWidth / 2, 0, -(faceOffset + diamondLength / 2)))
  local rightPoint = zoneCFrame:PointToWorldSpace(Vector3.new(diamondWidth / 2, 0, -(faceOffset + diamondLength / 2)))
  local segments = {
    {nearPoint, leftPoint},
    {nearPoint, rightPoint},
    {farPoint, leftPoint},
    {farPoint, rightPoint},
  }
  for index, segment in ipairs(segments) do
    local startPoint, endPoint = segment[1], segment[2]
    local midpoint = (startPoint + endPoint) / 2
    local delta = endPoint - startPoint
    local length = delta.Magnitude
    if length > 0.01 then
      local direction = delta.Unit
      local edge = visuals.edges[index]
      if edge then
        edge.Size = Vector3.new(0.35, 0.08, length)
        edge.CFrame = CFrame.lookAt(midpoint, midpoint + direction)
        edge.Transparency = config.ShowDiamond and 0.3 or 1
      end
    end
  end
  if visuals.circle then
    local circleCenter = Vector3.new(zoneCFrame.Position.X, zoneCFrame.Position.Y + 0.04, zoneCFrame.Position.Z)
    visuals.circle.Size = Vector3.new(0.08, config.CustomCircleRadius * 2, config.CustomCircleRadius * 2)
    visuals.circle.CFrame = CFrame.new(circleCenter) * CFrame.Angles(0, 0, math.rad(90))
    visuals.circle.Transparency = config.ShowCircle and 0.65 or 1
  end
  local insideDiamond = localRoot and isInsideDiamond(localRoot.Position, killerRoot.CFrame, killerRoot.Position) or false
  local insideCircle = localRoot and isInsideCircle(localRoot.Position, killerRoot.Position) or false
  local diamondColor = insideDiamond and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
  local circleColor = insideCircle and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
  for _, edge in ipairs(visuals.edges) do
    if edge and edge.Parent then
      edge.Color = diamondColor
    end
  end
  if visuals.circle and visuals.circle.Parent then
    visuals.circle.Color = circleColor
  end
end

local function startCustomZones()
  if customZoneState.running then return end
  customZoneState.running = true
  customZoneState.connections = {}
  customZoneState.killerZones = {}
  customZoneState.folder = Instance.new("Folder")
  customZoneState.folder.Name = "ABCustomZoneVisuals"
  customZoneState.folder.Parent = Workspace
  table.insert(customZoneState.connections, RunService.RenderStepped:Connect(function()
    if not customZoneState.running then return end
    local killersFolder = Workspace:FindFirstChild("Players") and Workspace.Players:FindFirstChild("Killers")
    if not killersFolder then return end
    local character = localPlayer.Character
    local localRoot = character and character:FindFirstChild("HumanoidRootPart")
    for _, killer in ipairs(killersFolder:GetChildren()) do
      if killer:IsA("Model") then
        local killerRoot = killer:FindFirstChild("HumanoidRootPart")
        if killerRoot then
          local visuals = customZoneState.killerZones[killer]
          if not visuals or not visuals.model or not visuals.model.Parent then
            if visuals and visuals.model then
              pcall(function()
                visuals.model:Destroy()
              end)
            end
            visuals = createZoneVisuals(killer)
            customZoneState.killerZones[killer] = visuals
          end
          updateZoneVisuals(visuals, killerRoot, localRoot)
        end
      end
    end
    for killer, visuals in pairs(customZoneState.killerZones) do
      if not killer.Parent or not killer:IsDescendantOf(Workspace) then
        if visuals.model then
          pcall(function()
            visuals.model:Destroy()
          end)
        end
        customZoneState.killerZones[killer] = nil
      end
    end
  end))
  print("[testbraken] Custom Zone ON")
end

local function stopCustomZones()
  if not customZoneState.running then return end
  customZoneState.running = false
  for _, connection in ipairs(customZoneState.connections) do
    pcall(function()
      connection:Disconnect()
    end)
  end
  customZoneState.connections = {}
  for _, visuals in pairs(customZoneState.killerZones) do
    if visuals.model then
      pcall(function()
        visuals.model:Destroy()
      end)
    end
  end
  customZoneState.killerZones = {}
  if customZoneState.folder then
    pcall(function()
      customZoneState.folder:Destroy()
    end)
    customZoneState.folder = nil
  end
  print("[testbraken] Custom Zone OFF")
end

local function refreshCustomZones()
  local wanted = config.ShowDiamond or config.ShowCircle
  if wanted and not customZoneState.running then
    startCustomZones()
  elseif not wanted and customZoneState.running then
    stopCustomZones()
  end
end

local function enforceBlockModeExclusivity()
  if config.AutoBlock and config.AutoBlockCustom then
    config.AutoBlockCustom = false
    if toggles.AutoBlockCustom then
      suppressCallbacks = true
      pcall(function()
        toggles.AutoBlockCustom:Set(false)
      end)
      suppressCallbacks = false
    end
  end
  if config.AutoBlock then
    if config.ShowDiamond then
      rememberedZones.diamond = true
      config.ShowDiamond = false
    end
    if config.ShowCircle then
      rememberedZones.circle = true
      config.ShowCircle = false
    end
    if toggles.ShowDiamond then
      suppressCallbacks = true
      pcall(function()
        toggles.ShowDiamond:Set(false)
      end)
      suppressCallbacks = false
    end
    if toggles.ShowCircle then
      suppressCallbacks = true
      pcall(function()
        toggles.ShowCircle:Set(false)
      end)
      suppressCallbacks = false
    end
  end
  refreshCustomZones()
end

local function watchKillerSounds(killer)
  if not killer then return end

  local function checkSound(sound)
    if not autoBlockState.running then return end
    if not (config.AutoBlock or config.AutoBlockCustom) then return end
    if not sound or not sound:IsA("Sound") then return end
    local soundId = sound.SoundId
    if soundId == "" then return end
    local numericId = soundId:match("rbxassetid://(%d+)") or soundId:match("://(%d+)") or soundId:match("^(%d+)$")
    local isBlockSound = blockSoundIds[soundId]
      or (numericId and (blockSoundIds["rbxassetid://" .. numericId] or blockSoundIds[numericId]))
    if not isBlockSound then return end
    if not autoBlockState.LocalRoot then return end
    local killerRoot = killer:FindFirstChild("HumanoidRootPart")
    if not killerRoot or not killerRoot.Parent then return end
    if config.AutoBlockCustom then
      if not isLocalPlayerInZone(killer) then return end
    else
      local offset = autoBlockState.LocalRoot.Position - killerRoot.Position
      local distance = offset.Magnitude
      if distance > 15 then return end
      if distance > 0 and killerRoot.CFrame.LookVector:Dot(offset.Unit) < 0.3 then return end
    end
    local now = tick()
    if now - autoBlockState.blueDebounce < 0.15 then return end
    autoBlockState.blueDebounce = now
    performBlock()
  end

  for _, descendant in ipairs(killer:GetDescendants()) do
    if descendant:IsA("Sound") then
      checkSound(descendant)
    end
  end
  table.insert(autoBlockState.connections, killer.DescendantAdded:Connect(checkSound))
end

local function checkKillerAbilities()
  if not autoBlockState.running or not (config.AutoBlock or config.AutoBlockCustom) then return end
  if not autoBlockState.KillersFolder or not autoBlockState.LocalRoot or not autoBlockState.LocalRoot.Parent then return end
  for _, killer in ipairs(autoBlockState.KillersFolder:GetChildren()) do
    if killer:IsA("Model") then
      local killerRoot = killer:FindFirstChild("HumanoidRootPart")
      if killerRoot then
        local abilityLastUsed = killer:GetAttribute("AbilityLastUsed") or 0
        local abilitiesUsed = killer:GetAttribute("AbilitiesUsed") or 0
        local previous = autoBlockState.attrStates[killer]
        if previous then
          local abilityChanged = abilityLastUsed > previous.lastAbility
          if abilitiesUsed > previous.lastUsed then
            previous.isBait = true
          end
          if abilityChanged then
            if previous.isBait then
              previous.isBait = false
            else
              local shouldBlock = false
              if config.AutoBlockCustom then
                if isLocalPlayerInZone(killer) then
                  shouldBlock = true
                end
              else
                local offset = autoBlockState.LocalRoot.Position - killerRoot.Position
                local distance = offset.Magnitude
                if distance <= 15 and distance > 0 and killerRoot.CFrame.LookVector:Dot(offset.Unit) >= 0.3 then
                  shouldBlock = true
                end
              end
              if shouldBlock then
                local now = tick()
                if now - autoBlockState.attrDebounce >= 0.15 then
                  autoBlockState.attrDebounce = now
                  performBlock()
                end
              end
            end
          end
          previous.lastAbility = abilityLastUsed
          previous.lastUsed = abilitiesUsed
        else
          autoBlockState.attrStates[killer] = {
            lastAbility = abilityLastUsed,
            lastUsed = abilitiesUsed,
            isBait = false,
          }
        end
      end
    end
  end
end

local function applyBlockToggle(request)
  if not request then return end
  if request.mode == "default" then
    config.AutoBlock = request.value
    if request.value then
      config.AutoBlockCustom = false
      if config.ShowDiamond then
        rememberedZones.diamond = true
        config.ShowDiamond = false
        if toggles.ShowDiamond then
          suppressCallbacks = true
          pcall(function()
            toggles.ShowDiamond:Set(false)
          end)
          suppressCallbacks = false
        end
      end
      if config.ShowCircle then
        rememberedZones.circle = true
        config.ShowCircle = false
        if toggles.ShowCircle then
          suppressCallbacks = true
          pcall(function()
            toggles.ShowCircle:Set(false)
          end)
          suppressCallbacks = false
        end
      end
      refreshCustomZones()
    end
  else
    config.AutoBlockCustom = request.value
    if request.value then
      config.AutoBlock = false
      if rememberedZones.diamond then
        config.ShowDiamond = true
        if toggles.ShowDiamond then
          suppressCallbacks = true
          pcall(function()
            toggles.ShowDiamond:Set(true)
          end)
          suppressCallbacks = false
        end
      end
      if rememberedZones.circle then
        config.ShowCircle = true
        if toggles.ShowCircle then
          suppressCallbacks = true
          pcall(function()
            toggles.ShowCircle:Set(true)
          end)
          suppressCallbacks = false
        end
      end
      rememberedZones.diamond = false
      rememberedZones.circle = false
      refreshCustomZones()
    end
  end
  if toggles.AutoBlock then
    suppressCallbacks = true
    pcall(function()
      toggles.AutoBlock:Set(config.AutoBlock)
    end)
    suppressCallbacks = false
  end
  if toggles.AutoBlockCustom then
    suppressCallbacks = true
    pcall(function()
      toggles.AutoBlockCustom:Set(config.AutoBlockCustom)
    end)
    suppressCallbacks = false
  end
  if config.AutoBlock or config.AutoBlockCustom then
    if not autoBlockState.running then
      pcall(startAutoBlock)
    end
  else
    if autoBlockState.running then
      pcall(stopAutoBlock)
    end
  end
  if fourthButtonState.applyTint then
    pcall(fourthButtonState.applyTint)
  end
end

local function schedulePendingToggle()
  if pendingToggleTask then
    pcall(task.cancel, pendingToggleTask)
    pendingToggleTask = nil
  end
  pendingToggleTask = task.delay(toggleDebounce, function()
    pendingToggleTask = nil
    local request = pendingToggle
    pendingToggle = nil
    if request ~= nil then
      lastToggleTime = tick()
      applyBlockToggle(request)
    end
  end)
end

local function requestBlockToggle(value, mode)
  if value == nil then return end
  mode = mode or (config.AutoBlockCustom and "custom" or "default")
  pendingToggle = {value = value, mode = mode}
  local now = tick()
  if lastToggleTime > 0 and now - lastToggleTime < toggleDebounce then
    schedulePendingToggle()
    return
  end
  if pendingToggleTask then
    pcall(task.cancel, pendingToggleTask)
    pendingToggleTask = nil
  end
  lastToggleTime = now
  local request = pendingToggle
  pendingToggle = nil
  applyBlockToggle(request)
end

local function startFourthButton()
  if fourthButtonState.running then return end
  fourthButtonState.running = true
  fourthButtonState.connections = {}

  do
    local mainUI = playerGui:FindFirstChild("MainUI")
    if mainUI then
      local abilityContainer = mainUI:FindFirstChild("AbilityContainer", true)
      if abilityContainer then
        local leftover = abilityContainer:FindFirstChild("FourthBlockAbility")
        if leftover then
          pcall(function()
            leftover:Destroy()
          end)
        end
      end
    end
  end

  if not fourthButtonState.applyTint then
    fourthButtonState.applyTint = function()
      local button = fourthButtonState.instance
      if not button or not button.Parent then return end
      local tint = (config.AutoBlock or config.AutoBlockCustom) and Color3.fromRGB(0, 255, 60) or Color3.fromRGB(255, 0, 0)
      if button:IsA("ImageButton") or button:IsA("ImageLabel") then
        button.ImageColor3 = tint
      end
      for _, descendant in ipairs(button:GetDescendants()) do
        if descendant:IsA("ImageLabel") or descendant:IsA("ImageButton") then
          descendant.ImageColor3 = tint
        elseif descendant:IsA("Frame") and descendant.BackgroundTransparency < 1 then
          descendant.BackgroundColor3 = tint
        end
      end
    end
  end

  local lastActivation = 0
  local activationCooldown = 0.15

  local function onFourthButtonActivated()
    local now = tick()
    if now - lastActivation < activationCooldown then return end
    lastActivation = now
    local target = config.FourthButtonTarget or "default"
    if target == "custom" then
      if config.AutoBlockCustom then
        requestBlockToggle(false, "custom")
      else
        requestBlockToggle(true, "custom")
      end
    else
      if config.AutoBlock then
        requestBlockToggle(false, "default")
      else
        requestBlockToggle(true, "default")
      end
    end
  end

  table.insert(fourthButtonState.connections, RunService.RenderStepped:Connect(function()
    if not fourthButtonState.running then return end
    local button = fourthButtonState.instance
    if button and button.Parent then
      local okPosition, position = pcall(function()
        return button.AbsolutePosition
      end)
      local okSize, size = pcall(function()
        return button.AbsoluteSize
      end)
      if okPosition and okSize then
        fourthButtonState.cachedPos = position
        fourthButtonState.cachedSize = size
      end
    else
      fourthButtonState.cachedPos = nil
      fourthButtonState.cachedSize = nil
    end
  end))

  local function isPointOverButton(point)
    local button = fourthButtonState.instance
    if not button or not button.Parent then return false end
    local ok, objects = pcall(function()
      return UserInputService:GetGuiObjectsAtPosition(point.X, point.Y)
    end)
    if ok and objects and #objects > 0 then
      local topObject = objects[1]
      return topObject == button or topObject:IsDescendantOf(button)
    end
    if not fourthButtonState.cachedPos or not fourthButtonState.cachedSize then return false end
    local position, size = fourthButtonState.cachedPos, fourthButtonState.cachedSize
    return point.X >= position.X and point.X <= position.X + size.X
      and point.Y >= position.Y and point.Y <= position.Y + size.Y
  end

  local pressPosition, pressTime = nil, 0

  table.insert(fourthButtonState.connections, UserInputService.InputBegan:Connect(function(input)
    if not fourthButtonState.running then return end
    if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then
      return
    end
    if not isPointOverButton(input.Position) then return end
    pressPosition = input.Position
    pressTime = tick()
  end))

  table.insert(fourthButtonState.connections, UserInputService.InputEnded:Connect(function(input)
    if not fourthButtonState.running then return end
    if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then
      return
    end
    if not pressPosition then return end
    local heldFor = tick() - pressTime
    pressPosition = nil
    if heldFor > 0.5 then return end
    if not isPointOverButton(input.Position) then return end
    onFourthButtonActivated()
  end))

  local function hookButtonInput(root)
    if not root then return end
    local function hookObject(object)
      if not object then return end
      if object:IsA("GuiButton") then
        pcall(function()
          object.Active = true
          object.Selectable = true
        end)
        pcall(function()
          object.MouseButton1Click:Connect(onFourthButtonActivated)
        end)
        pcall(function()
          object.Activated:Connect(onFourthButtonActivated)
        end)
      end
    end
    hookObject(root)
    for _, descendant in ipairs(root:GetDescendants()) do
      if descendant:IsA("GuiObject") then
        hookObject(descendant)
      end
    end
  end

  task.spawn(function()
    while fourthButtonState.running do
      task.wait(0.5)
      if not fourthButtonState.running then break end
      local mainUI = playerGui:FindFirstChild("MainUI")
      if mainUI then
        local abilityContainer = mainUI:FindFirstChild("AbilityContainer", true)
        if abilityContainer then
          local blockButton = abilityContainer:FindFirstChild("Block")
          local cloneButton = abilityContainer:FindFirstChild("Clone")
          local activeMode = getActiveBlockMode()
          local source = nil
          if blockButton and cloneButton then
            source = (activeMode == "007n7") and cloneButton or blockButton
          else
            source = blockButton or cloneButton
          end
          local existing = abilityContainer:FindFirstChild("FourthBlockAbility")
          local needsRebuild = false
          if not existing then
            needsRebuild = (source ~= nil)
          elseif not source then
            needsRebuild = false
          elseif fourthButtonState.sourceName ~= source.Name then
            needsRebuild = true
          elseif fourthButtonState.instance ~= existing then
            fourthButtonState.instance = existing
            hookButtonInput(existing)
            if fourthButtonState.applyTint then
              fourthButtonState.applyTint()
            end
          end
          if needsRebuild and source then
            if existing then
              pcall(function()
                existing:Destroy()
              end)
            end
            local copy = source:Clone()
            copy.Name = "FourthBlockAbility"
            copy.LayoutOrder = 4
            if copy:IsA("GuiObject") then
              copy.ZIndex = 50
            end
            for _, descendant in ipairs(copy:GetDescendants()) do
              if descendant:IsA("TextLabel") or descendant:IsA("TextButton") then
                local loweredText = descendant.Text:lower()
                if loweredText:find("block") or loweredText:find("clone") then
                  descendant.Text = ""
                  descendant.Visible = false
                end
              end
              if descendant:IsA("GuiObject") then
                descendant.ZIndex = math.max(descendant.ZIndex, 50)
                descendant.Active = true
              end
            end
            copy.Parent = abilityContainer
            fourthButtonState.instance = copy
            fourthButtonState.sourceName = source.Name
            hookButtonInput(copy)
            if fourthButtonState.applyTint then
              fourthButtonState.applyTint()
            end
            print("[testbraken] ✅ 4th button created from:", source.Name)
          end
        end
      end
    end
  end)

  print("[testbraken] AutoBlockButton ON")
end

local function stopFourthButton()
  if not fourthButtonState.running then return end
  fourthButtonState.running = false
  for _, connection in ipairs(fourthButtonState.connections) do
    pcall(function()
      connection:Disconnect()
    end)
  end
  fourthButtonState.connections = {}
  if fourthButtonState.instance and fourthButtonState.instance.Parent then
    pcall(function()
      fourthButtonState.instance:Destroy()
    end)
  end
  fourthButtonState.instance = nil
  fourthButtonState.cachedPos = nil
  fourthButtonState.cachedSize = nil
  fourthButtonState.sourceName = nil
  print("[testbraken] AutoBlockButton OFF")
end

function startAutoBlock()
  if autoBlockState.running then return end
  autoBlockState.running = true
  autoBlockState.generation = autoBlockState.generation + 1
  local generation = autoBlockState.generation
  autoBlockState.attrStates = {}

  local character = localPlayer.Character
  if character then
    autoBlockState.LocalRoot = character:FindFirstChild("HumanoidRootPart")
    watchPunchSounds(character)
  end
  table.insert(autoBlockState.connections, localPlayer.CharacterAdded:Connect(function(newCharacter)
    autoBlockState.LocalRoot = newCharacter:WaitForChild("HumanoidRootPart", 5)
    watchPunchSounds(newCharacter)
  end))

  local function watchKiller(killer)
    if not killer or not killer:IsA("Model") then return end
    watchKillerSounds(killer)
  end

  local function attachToKillersFolder(folder)
    if not folder then return false end
    autoBlockState.KillersFolder = folder
    table.insert(autoBlockState.connections, folder.ChildAdded:Connect(function(child)
      if autoBlockState.running and autoBlockState.generation == generation then
        task.wait(0.1)
        watchKiller(child)
      end
    end))
    for _, child in ipairs(folder:GetChildren()) do
      watchKiller(child)
    end
    return true
  end

  local playersFolder = Workspace:FindFirstChild("Players")
  local killersFolder = playersFolder and playersFolder:FindFirstChild("Killers")
  if not attachToKillersFolder(killersFolder) then
    task.spawn(function()
      local attempts = 0
      while autoBlockState.running and autoBlockState.generation == generation and attempts < 60 do
        attempts = attempts + 1
        task.wait(1)
        local retryPlayers = Workspace:FindFirstChild("Players")
        local retryKillers = retryPlayers and retryPlayers:FindFirstChild("Killers")
        if retryKillers and attachToKillersFolder(retryKillers) then
          break
        end
      end
    end)
  end

  table.insert(autoBlockState.connections, RunService.Heartbeat:Connect(function()
    if not autoBlockState.running or autoBlockState.generation ~= generation then return end
    checkKillerAbilities()
  end))

  if fourthButtonState.applyTint then
    fourthButtonState.applyTint()
  end
  print("[testbraken] AutoBlock ON")
end

function stopAutoBlock()
  autoBlockState.running = false
  autoBlockState.generation = autoBlockState.generation + 1
  autoBlockState.attrStates = {}
  for _, connection in ipairs(autoBlockState.connections) do
    pcall(function()
      connection:Disconnect()
    end)
  end
  autoBlockState.connections = {}
  print("[testbraken] AutoBlock OFF")
end

local minFov, maxFov = 30, 120
local lastFovChange = 0
local fovBindName = "TestHub_FOVForce"

local function applyFov()
  local camera = Workspace.CurrentCamera
  if camera and camera.FieldOfView ~= config.FOVValue then
    pcall(function()
      camera.FieldOfView = config.FOVValue
    end)
  end
end

pcall(function()
  RunService:UnbindFromRenderStep(fovBindName)
end)
pcall(function()
  RunService:BindToRenderStep(fovBindName, Enum.RenderPriority.Last.Value + 1, function()
    local camera = Workspace.CurrentCamera
    if camera and camera.FieldOfView ~= config.FOVValue then
      pcall(function()
        camera.FieldOfView = config.FOVValue
      end)
    end
  end)
end)

local fovConnection = nil

local function watchCameraFov(camera)
  if fovConnection then
    pcall(function()
      fovConnection:Disconnect()
    end)
    fovConnection = nil
  end
  if not camera then return end
  fovConnection = camera:GetPropertyChangedSignal("FieldOfView"):Connect(function()
    if camera.FieldOfView ~= config.FOVValue then
      pcall(function()
        camera.FieldOfView = config.FOVValue
      end)
    end
  end)
end

watchCameraFov(Workspace.CurrentCamera)
Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
  watchCameraFov(Workspace.CurrentCamera)
end)

RunService.Stepped:Connect(function()
  local camera = Workspace.CurrentCamera
  if camera and camera.FieldOfView ~= config.FOVValue then
    pcall(function()
      camera.FieldOfView = config.FOVValue
    end)
  end
end)

RunService.Heartbeat:Connect(function()
  local camera = Workspace.CurrentCamera
  if camera and camera.FieldOfView ~= config.FOVValue then
    pcall(function()
      camera.FieldOfView = config.FOVValue
    end)
  end
end)

localPlayer.CharacterAdded:Connect(function()
  task.wait(0.1)
  applyFov()
  task.wait(0.4)
  applyFov()
  task.wait(0.6)
  applyFov()
end)

local function scheduleFovApply()
  lastFovChange = tick()
  task.delay(0.1, function()
    if tick() - lastFovChange >= 0.05 then
      applyFov()
    end
  end)
end

local lowGraphicsState = {
  enabled = false,
  saved = {},
  destroyed = {},
  lightSaved = {},
  terrainSaved = {},
  conn = nil,
}

local function saveProperty(instance, property)
  if not lowGraphicsState.saved[instance] then
    lowGraphicsState.saved[instance] = {}
  end
  if lowGraphicsState.saved[instance][property] == nil then
    local ok, value = pcall(function()
      return instance[property]
    end)
    if ok then
      lowGraphicsState.saved[instance][property] = value
    end
  end
end

local function saveDestroyed(instance)
  if lowGraphicsState.destroyed[instance] then return end
  local parent = instance.Parent
  if not parent then return end
  local ok, copy = pcall(function()
    return instance:Clone()
  end)
  if ok and copy then
    lowGraphicsState.destroyed[instance] = {Clone = copy, Parent = parent}
  end
end

local function stripInstance(instance)
  if not lowGraphicsState.enabled then return end
  if instance:IsA("BasePart") then
    for _, property in ipairs({
      "CastShadow", "Material", "Reflectance", "BackSurface", "BottomSurface",
      "FrontSurface", "LeftSurface", "RightSurface", "TopSurface",
    }) do
      saveProperty(instance, property)
    end
    instance.CastShadow = false
    instance.Material = Enum.Material.Plastic
    instance.Reflectance = 0
    instance.BackSurface = Enum.SurfaceType.SmoothNoOutlines
    instance.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
    instance.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
    instance.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
    instance.RightSurface = Enum.SurfaceType.SmoothNoOutlines
    instance.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  elseif instance:IsA("Decal") then
    saveProperty(instance, "Transparency")
    saveProperty(instance, "Texture")
    instance.Transparency = 1
    instance.Texture = ""
  elseif instance:IsA("ParticleEmitter") or instance:IsA("Trail") then
    saveProperty(instance, "Lifetime")
    instance.Lifetime = NumberRange.new(0)
  elseif instance:IsA("ForceField") or instance:IsA("Sparkles") or instance:IsA("Smoke")
    or instance:IsA("Fire") or instance:IsA("Beam") then
    saveDestroyed(instance)
    instance:Destroy()
  end
end

local function startLowGraphics()
  if lowGraphicsState.enabled then return end
  lowGraphicsState.enabled = true
  local terrain = Workspace:FindFirstChildWhichIsA("Terrain")
  if terrain then
    lowGraphicsState.terrainSaved = {
      WaterWaveSize = terrain.WaterWaveSize,
      WaterWaveSpeed = terrain.WaterWaveSpeed,
      WaterReflectance = terrain.WaterReflectance,
      WaterTransparency = terrain.WaterTransparency,
    }
    terrain.WaterWaveSize = 0
    terrain.WaterWaveSpeed = 0
    terrain.WaterReflectance = 0
    terrain.WaterTransparency = 1
  end
  lowGraphicsState.lightSaved = {
    GlobalShadows = Lighting.GlobalShadows,
    FogEnd = Lighting.FogEnd,
    FogStart = Lighting.FogStart,
  }
  Lighting.GlobalShadows = false
  Lighting.FogEnd = 9e9
  Lighting.FogStart = 9e9
  pcall(function()
    settings().Rendering.QualityLevel = 1
  end)
  for _, descendant in pairs(Workspace:GetDescendants()) do
    pcall(stripInstance, descendant)
  end
  for _, descendant in pairs(Lighting:GetDescendants()) do
    if descendant:IsA("PostEffect") then
      saveProperty(descendant, "Enabled")
      descendant.Enabled = false
    end
  end
  lowGraphicsState.conn = Workspace.DescendantAdded:Connect(function(descendant)
    if not lowGraphicsState.enabled then return end
    task.defer(function()
      pcall(stripInstance, descendant)
    end)
  end)
end

local function stopLowGraphics()
  if not lowGraphicsState.enabled then return end
  lowGraphicsState.enabled = false
  if lowGraphicsState.conn then
    lowGraphicsState.conn:Disconnect()
    lowGraphicsState.conn = nil
  end
  for instance, properties in pairs(lowGraphicsState.saved) do
    if instance and instance.Parent then
      for property, value in pairs(properties) do
        pcall(function()
          instance[property] = value
        end)
      end
    end
  end
  for _, entry in pairs(lowGraphicsState.destroyed) do
    if entry.Clone and entry.Parent and entry.Parent.Parent then
      pcall(function()
        entry.Clone.Parent = entry.Parent
      end)
    end
  end
  local terrain = Workspace:FindFirstChildWhichIsA("Terrain")
  if terrain then
    for property, value in pairs(lowGraphicsState.terrainSaved) do
      pcall(function()
        terrain[property] = value
      end)
    end
  end
  for property, value in pairs(lowGraphicsState.lightSaved) do
    pcall(function()
      Lighting[property] = value
    end)
  end
  table.clear(lowGraphicsState.saved)
  table.clear(lowGraphicsState.destroyed)
  table.clear(lowGraphicsState.terrainSaved)
  table.clear(lowGraphicsState.lightSaved)
end

local function enableMaxZoom()
  localPlayer.CameraMaxZoomDistance = 10000
end

local function disableMaxZoom()
  localPlayer.CameraMaxZoomDistance = 5
end

localPlayer.CameraMinZoomDistance = 0.5
localPlayer.CameraMaxZoomDistance = 5

local fpsMonitorState = {enabled = false, gui = nil, label = nil, conn = nil, frames = 0, elapsed = 0}

local function startFpsMonitor()
  if fpsMonitorState.enabled then return end
  fpsMonitorState.enabled = true
  if not fpsMonitorState.gui then
    local screenGui = Instance.new("ScreenGui")
    screenGui.Name = "FPSPingMonitor"
    screenGui.ResetOnSpawn = false
    screenGui.IgnoreGuiInset = true
    screenGui.DisplayOrder = 999998
    screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
    screenGui.Parent = CoreGui
    fpsMonitorState.gui = screenGui

    local frame = Instance.new("Frame")
    frame.AnchorPoint = Vector2.new(1, 0)
    frame.Position = UDim2.new(1, -2, 0, -1)
    frame.Size = UDim2.new(0, 112, 0, 22)
    frame.BackgroundColor3 = Color3.fromRGB(15, 30, 20)
    frame.BackgroundTransparency = 0.15
    frame.BorderSizePixel = 0
    frame.Parent = screenGui

    local corner = Instance.new("UICorner")
    corner.CornerRadius = UDim.new(0, 4)
    corner.Parent = frame

    local label = Instance.new("TextLabel")
    label.Size = UDim2.new(1, -4, 1, 0)
    label.Position = UDim2.new(0, 2, 0, 0)
    label.BackgroundTransparency = 1
    label.Font = Enum.Font.GothamBold
    label.TextSize = 11
    label.TextColor3 = Color3.fromRGB(80, 255, 130)
    label.TextXAlignment = Enum.TextXAlignment.Center
    label.TextYAlignment = Enum.TextYAlignment.Center
    label.Text = "FPS: -- | PING: -- ms"
    label.Parent = frame
    fpsMonitorState.label = label
  end
  fpsMonitorState.gui.Enabled = true
  fpsMonitorState.frames = 0
  fpsMonitorState.elapsed = 0
  fpsMonitorState.conn = RunService.RenderStepped:Connect(function(deltaTime)
    if not fpsMonitorState.enabled then return end
    fpsMonitorState.frames = fpsMonitorState.frames + 1
    fpsMonitorState.elapsed = fpsMonitorState.elapsed + deltaTime
    if fpsMonitorState.elapsed >= 1 then
      local fps = math.floor(fpsMonitorState.frames / fpsMonitorState.elapsed + 0.5)
      fpsMonitorState.frames, fpsMonitorState.elapsed = 0, 0
      local pingText = "--"
      pcall(function()
        local network = Stats.Network
        local dataPing = network and network.ServerStatsItem and network.ServerStatsItem["Data Ping"]
        if dataPing then
          pingText = math.floor(dataPing:GetValue() + 0.5)
        end
      end)
      if fpsMonitorState.label then
        fpsMonitorState.label.Text = "FPS: " .. fps .. " | PING: " .. pingText .. " ms"
      end
    end
  end)
end

local function stopFpsMonitor()
  fpsMonitorState.enabled = false
  if fpsMonitorState.conn then
    fpsMonitorState.conn:Disconnect()
    fpsMonitorState.conn = nil
  end
  if fpsMonitorState.gui then
    fpsMonitorState.gui.Enabled = false
  end
end

local noclipCamState = {enabled = false, applied = false, orig = nil, mod = nil}

local function findPopperModule()
  local playerScripts = localPlayer:FindFirstChild("PlayerScripts")
  if not playerScripts then return nil end
  local playerModule = playerScripts:FindFirstChild("PlayerModule")
  if not playerModule then return nil end
  local cameraModule = playerModule:FindFirstChild("CameraModule")
  if not cameraModule then return nil end
  local zoomController = cameraModule:FindFirstChild("ZoomController")
  if not zoomController then return nil end
  return zoomController:FindFirstChild("Popper")
end

local function patchPopper()
  if noclipCamState.applied then return true end
  noclipCamState.mod = findPopperModule()
  if not noclipCamState.mod then return false end
  local setConstant = debug and debug.setconstant
  local getConstants = debug and debug.getconstants
  if not (setConstant and getConstants and getgc) then return false end
  noclipCamState.orig = {}
  for _, candidate in pairs(getgc()) do
    if type(candidate) == "function" then
      local okEnv, environment = pcall(function()
        return getfenv(candidate)
      end)
      if okEnv and environment and environment.script == noclipCamState.mod then
        local okConstants, constants = pcall(getConstants, candidate)
        if okConstants and constants then
          for index, constant in pairs(constants) do
            if tonumber(constant) == 0.25 then
              noclipCamState.orig[candidate] = noclipCamState.orig[candidate] or {}
              noclipCamState.orig[candidate][index] = constant
              pcall(setConstant, candidate, index, 0)
            elseif tonumber(constant) == 0 then
              noclipCamState.orig[candidate] = noclipCamState.orig[candidate] or {}
              noclipCamState.orig[candidate][index] = constant
              pcall(setConstant, candidate, index, 0.25)
            end
          end
        end
      end
    end
  end
  noclipCamState.applied = true
  return true
end

local function unpatchPopper()
  if not noclipCamState.orig or not noclipCamState.mod then
    noclipCamState.applied = false
    return
  end
  local setConstant = debug and debug.setconstant
  if setConstant then
    for candidate, constants in pairs(noclipCamState.orig) do
      for index, constant in pairs(constants) do
        pcall(setConstant, candidate, index, constant)
      end
    end
  end
  noclipCamState.orig = nil
  noclipCamState.applied = false
end

local function startNoclipCam()
  noclipCamState.enabled = true
  task.spawn(function()
    local attempts = 0
    while not noclipCamState.applied and attempts < 20 do
      attempts = attempts + 1
      if patchPopper() then
        break
      end
      task.wait(0.5)
    end
  end)
end

local function stopNoclipCam()
  noclipCamState.enabled = false
  unpatchPopper()
end

local killerEspState = {running = false, connAdd = nil, connIngameAdd = nil}
local survivorEspState = {running = false, connAdd = nil}
local espHighlightName = "testbraken_ESP_HL"
local espSettings = {
  KillerColor = Color3.fromRGB(255, 50, 50),
  SurvivorColor = Color3.fromRGB(50, 255, 50),
  FillTransparency = 0.5,
  OutlineTransparency = 0,
}
local highlightWatchers = {}

local function applyHighlight(model, color)
  if not model or not model.Parent then return end
  if model:GetAttribute("Username") == localPlayer.Name then return end
  local existing = model:FindFirstChild(espHighlightName)
  if existing then
    existing.FillColor = color
    existing.OutlineColor = color
    return existing
  end
  for _, descendant in ipairs(model:GetDescendants()) do
    if descendant:IsA("Highlight") and descendant.Name ~= espHighlightName then
      descendant:Destroy()
      break
    end
  end
  existing = Instance.new("Highlight")
  existing.Name = espHighlightName
  existing.Adornee = model
  existing.FillColor = color
  existing.OutlineColor = color
  existing.FillTransparency = espSettings.FillTransparency
  existing.OutlineTransparency = espSettings.OutlineTransparency
  existing.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  existing.Parent = model
  if not highlightWatchers[model] then
    highlightWatchers[model] = model.ChildAdded:Connect(function(child)
      if child:IsA("Highlight") and child.Name ~= espHighlightName then
        task.wait(3)
        task.defer(function()
          if child.Parent then
            child:Destroy()
          end
          local own = model:FindFirstChild(espHighlightName)
          if own then
            own.FillColor = color
            own.OutlineColor = color
          end
        end)
      end
    end)
  end
  return existing
end

local function removeHighlight(model)
  if not model then return end
  local existing = model:FindFirstChild(espHighlightName)
  if existing then
    existing:Destroy()
  end
  if highlightWatchers[model] then
    pcall(function()
      highlightWatchers[model]:Disconnect()
    end)
    highlightWatchers[model] = nil
  end
end

local function startKillerEsp()
  if killerEspState.running then return end
  killerEspState.running = true
  local killersFolder = Workspace:WaitForChild("Players", 10)
  killersFolder = killersFolder and killersFolder:FindFirstChild("Killers")
  if not killersFolder then
    print("[testbraken] KillerESP: Killers folder not found")
    return
  end
  local ingame = Workspace:FindFirstChild("Map") and Workspace.Map:FindFirstChild("Ingame")
  for _, killer in ipairs(killersFolder:GetChildren()) do
    applyHighlight(killer, espSettings.KillerColor)
  end
  if ingame then
    for _, child in ipairs(ingame:GetChildren()) do
      local humanoid = child:FindFirstChildOfClass("Humanoid")
      if humanoid and not Players:GetPlayerFromCharacter(child) and humanoid.WalkSpeed ~= 16 and humanoid.WalkSpeed ~= 26 then
        applyHighlight(child, Color3.fromRGB(180, 0, 0))
      end
    end
    killerEspState.connIngameAdd = ingame.ChildAdded:Connect(function(child)
      if not killerEspState.running then return end
      task.wait(0.5)
      local humanoid = child:FindFirstChildOfClass("Humanoid")
      if humanoid and not Players:GetPlayerFromCharacter(child) and humanoid.WalkSpeed ~= 16 and humanoid.WalkSpeed ~= 26 then
        applyHighlight(child, Color3.fromRGB(180, 0, 0))
      end
    end)
  end
  killerEspState.connAdd = killersFolder.ChildAdded:Connect(function(child)
    if not killerEspState.running then return end
    task.wait(0.5)
    applyHighlight(child, espSettings.KillerColor)
  end)
  print("[testbraken] KillerESP ON")
end

local function stopKillerEsp()
  if not killerEspState.running then return end
  killerEspState.running = false
  if killerEspState.connAdd then
    pcall(function()
      killerEspState.connAdd:Disconnect()
    end)
    killerEspState.connAdd = nil
  end
  if killerEspState.connIngameAdd then
    pcall(function()
      killerEspState.connIngameAdd:Disconnect()
    end)
    killerEspState.connIngameAdd = nil
  end
  local killersFolder = Workspace:FindFirstChild("Players") and Workspace.Players:FindFirstChild("Killers")
  if killersFolder then
    for _, killer in ipairs(killersFolder:GetChildren()) do
      removeHighlight(killer)
    end
  end
  local ingame = Workspace:FindFirstChild("Map") and Workspace.Map:FindFirstChild("Ingame")
  if ingame then
    for _, descendant in ipairs(ingame:GetDescendants()) do
      if descendant:IsA("Highlight") and descendant.Name == espHighlightName then
        descendant:Destroy()
      end
    end
  end
  print("[testbraken] KillerESP OFF")
end

local function startSurvivorEsp()
  if survivorEspState.running then return end
  survivorEspState.running = true
  local survivorsFolder = Workspace:WaitForChild("Players", 10)
  survivorsFolder = survivorsFolder and survivorsFolder:FindFirstChild("Survivors")
  if not survivorsFolder then
    print("[testbraken] SurvivorESP: Survivors folder not found")
    return
  end
  for _, survivor in ipairs(survivorsFolder:GetChildren()) do
    if survivor ~= localPlayer.Character then
      applyHighlight(survivor, espSettings.SurvivorColor)
    end
  end
  survivorEspState.connAdd = survivorsFolder.ChildAdded:Connect(function(child)
    if not survivorEspState.running then return end
    task.wait(0.5)
    if child ~= localPlayer.Character then
      applyHighlight(child, espSettings.SurvivorColor)
    end
  end)
  print("[testbraken] SurvivorESP ON")
end

local function stopSurvivorEsp()
  if not survivorEspState.running then return end
  survivorEspState.running = false
  if survivorEspState.connAdd then
    pcall(function()
      survivorEspState.connAdd:Disconnect()
    end)
    survivorEspState.connAdd = nil
  end
  local survivorsFolder = Workspace:FindFirstChild("Players") and Workspace.Players:FindFirstChild("Survivors")
  if survivorsFolder then
    for _, survivor in ipairs(survivorsFolder:GetChildren()) do
      removeHighlight(survivor)
    end
  end
  print("[testbraken] SurvivorESP OFF")
end

local staminaState = {
  InfStamina = false,
  AlwaysSprint = false,
  running = false,
  conn = nil,
  Sprinting = nil,
}

local function loadSprintingModule()
  if staminaState.Sprinting then
    return staminaState.Sprinting
  end
  local ok, module = pcall(function()
    return require(
      ReplicatedStorage:WaitForChild("Systems", 5)
        :WaitForChild("Character", 5)
        :WaitForChild("Game", 5)
        :WaitForChild("Sprinting", 5)
    )
  end)
  if ok and module then
    staminaState.Sprinting = module
  end
  return staminaState.Sprinting
end

local function startStaminaLoop()
  if staminaState.running then return end
  staminaState.running = true
  task.spawn(function()
    while staminaState.running do
      task.wait(0.1)
      local sprinting = staminaState.Sprinting
      if sprinting then
        if staminaState.InfStamina then
          sprinting.Stamina = sprinting.MaxStamina or 100
          sprinting.StaminaLossDisabled = true
        end
        if staminaState.AlwaysSprint then
          if not sprinting.IsSprinting then
            sprinting.IsSprinting = true
            if sprinting.__sprintedEvent then
              sprinting.__sprintedEvent:Fire(true)
            end
          end
        end
      end
    end
  end)
end

local function stopStaminaLoop()
  staminaState.running = false
  local sprinting = staminaState.Sprinting
  if sprinting then
    sprinting.StaminaLossDisabled = false
    sprinting.IsSprinting = false
    if sprinting.__sprintedEvent then
      sprinting.__sprintedEvent:Fire(false)
    end
  end
end

local function refreshStamina()
  local wanted = staminaState.InfStamina or staminaState.AlwaysSprint
  if wanted then
    loadSprintingModule()
    startStaminaLoop()
  else
    stopStaminaLoop()
  end
end

local window = WindUI:CreateWindow({
  Title = "testbraken",
  Icon = "monitor",
  Author = "saken",
  Folder = "TestHub",
  Size = UDim2.fromOffset(600, 500),
  Transparent = true,
  Theme = "Dark",
  User = {Enabled = true, Anonymous = true},
})

window:EditOpenButton({
  Title = "testbraken",
  Icon = "monitor",
  CornerRadius = UDim.new(0, 16),
  StrokeThickness = 2,
  Color = ColorSequence.new(Color3.fromRGB(255, 60, 60), Color3.fromRGB(255, 150, 150)),
  OnlyMobile = false,
  Enabled = true,
  Draggable = true,
})

local function syncZoneInputs()
  if inputs.CustomDiamondLength then
    pcall(function()
      inputs.CustomDiamondLength:Set(tostring(config.CustomDiamondLength))
    end)
  end
  if inputs.CustomDiamondWidth then
    pcall(function()
      inputs.CustomDiamondWidth:Set(tostring(config.CustomDiamondWidth))
    end)
  end
  if inputs.CustomDiamondOffset then
    pcall(function()
      inputs.CustomDiamondOffset:Set(tostring(config.CustomDiamondOffset))
    end)
  end
  if inputs.CustomCircleRadius then
    pcall(function()
      inputs.CustomCircleRadius:Set(tostring(config.CustomCircleRadius))
    end)
  end
  if inputs.ZoneHeight then
    pcall(function()
      inputs.ZoneHeight:Set(tostring(config.ZoneHeight))
    end)
  end
end

local mainTab = window:Tab({Title = "Main", Icon = "house"})

mainTab:Section({Title = "🇻🇳 Lời tri ân"})
mainTab:Paragraph({
  Title = "Gửi đến tất cả chúng ta",
  Desc = "Chúng ta — những con người nhỏ bé giữa vũ trụ code mênh mông — đã cùng nhau dệt nên một giấc mơ.\n\nTừ những dòng lệnh đầu tiên của DeepSeek, ChatGPT, Gemini và Google, đến những đêm trắng của \"tôi\" và \"bạn\", một sản phẩm nhỏ nhưng chứa đựng biết bao tâm huyết đã ra đời.\n\nKhông có AI nào thay thế được con người, cũng chẳng con người nào có thể một mình đi hết con đường này. Chúng ta là một tập thể — người và máy — cùng chung một nhịp đập.\n\nCảm ơn vì đã không bỏ cuộc.\nCảm ơn vì đã tin tưởng.\nVà cảm ơn — vì đã ở đây, ngay lúc này. 💙",
})

mainTab:Section({Title = "🇬🇧 Dedication"})
mainTab:Paragraph({
  Title = "To all of us",
  Desc = "We — small humans in the vast universe of code — wove a dream together.\n\nFrom the first lines of DeepSeek, ChatGPT, Gemini and Google, to the sleepless nights of \"you\" and \"me\", a small product carrying immense dedication was born.\n\nNo AI can replace humans, and no human can walk this path alone. We are one — human and machine — beating with the same heart.\n\nThank you for never giving up.\nThank you for believing.\nAnd thank you — for being here, right now. 💙",
})

mainTab:Section({Title = "Credits"})
mainTab:Paragraph({
  Title = "Made by",
  Desc = "• You — idea, testing, direction\n• DeepSeek — main coding assistant\n• ChatGPT (OpenAI) — logic & reasoning\n• Gemini (Google) — analysis & expansion\n• Google — search & reference",
})

local espTab = window:Tab({Title = "ESP", Icon = "eye"})

espTab:Section({Title = "Players"})
toggles.KillerESP = espTab:Toggle({
  Title = "Killer ESP",
  Value = false,
  Callback = function(enabled)
    if enabled then
      startKillerEsp()
    else
      stopKillerEsp()
    end
  end,
})
espTab:Toggle({
  Title = "Killer ESP Color (Red)",
  Value = false,
  Callback = function(alternate)
    espSettings.KillerColor = alternate and Color3.fromRGB(255, 165, 0) or Color3.fromRGB(255, 50, 50)
  end,
})
toggles.SurvivorESP = espTab:Toggle({
  Title = "Survivor ESP",
  Value = false,
  Callback = function(enabled)
    if enabled then
      startSurvivorEsp()
    else
      stopSurvivorEsp()
    end
  end,
})
espTab:Toggle({
  Title = "Survivor ESP Color (Green)",
  Value = false,
  Callback = function(alternate)
    espSettings.SurvivorColor = alternate and Color3.fromRGB(0, 200, 255) or Color3.fromRGB(50, 255, 50)
  end,
})

espTab:Section({Title = "Entities"})
toggles.MinionESP = espTab:Toggle({
  Title = "Minion ESP (c00lkidd / 1x1x1x1)",
  Value = config.MinionESP,
  Callback = function(enabled)
    config.MinionESP = enabled
    if enabled then
      startMinionEsp()
    else
      stopMinionEsp()
    end
  end,
})
toggles.ProjectileESP = espTab:Toggle({
  Title = "Projectile ESP (c00lkidd)",
  Value = config.ProjectileESP,
  Callback = function(enabled)
    config.ProjectileESP = enabled
    if enabled then
      startProjectileEsp()
    else
      stopProjectileEsp()
    end
  end,
})
toggles.AzureTrapESP = espTab:Toggle({
  Title = "Azure Trap ESP",
  Value = config.AzureTrapESP,
  Callback = function(enabled)
    config.AzureTrapESP = enabled
    if enabled then
      startAzureTrapEsp()
    else
      stopAzureTrapEsp()
    end
  end,
})

local autoBlockTab = window:Tab({Title = "Auto Block", Icon = "shield"})

autoBlockTab:Section({Title = "Auto Block (Default)"})
toggles.AutoBlock = autoBlockTab:Toggle({
  Title = "Auto Block",
  Value = config.AutoBlock,
  Callback = function(enabled)
    if suppressCallbacks then return end
    requestBlockToggle(enabled, "default")
  end,
})
toggles.ABModeDropdown = autoBlockTab:Dropdown({
  Title = "Auto Block Mode",
  Values = {"Guest 1337", "007n7"},
  Value = (config.ABMode == "007n7") and "007n7" or "Guest 1337",
  Callback = function(selected)
    config.ABMode = (selected == "007n7") and "007n7" or "Guest1337"
  end,
})
toggles.AimPunch = autoBlockTab:Toggle({
  Title = "Auto Aim + Punch",
  Value = config.AimPunch,
  Callback = function(enabled)
    config.AimPunch = enabled
  end,
})
toggles.AutoBlockButton = autoBlockTab:Toggle({
  Title = "Auto Block Button",
  Value = config.AutoBlockButton,
  Callback = function(enabled)
    config.AutoBlockButton = enabled
    if enabled then
      startFourthButton()
    else
      stopFourthButton()
    end
  end,
})
toggles.FourthButtonTargetDropdown = autoBlockTab:Dropdown({
  Title = "4th Button Target",
  Values = {"Default", "Custom"},
  Value = (config.FourthButtonTarget == "custom") and "Custom" or "Default",
  Callback = function(selected)
    config.FourthButtonTarget = (selected == "Custom") and "custom" or "default"
  end,
})

autoBlockTab:Section({Title = "Auto Block Custom"})
toggles.AutoBlockCustom = autoBlockTab:Toggle({
  Title = "Auto Block Custom",
  Value = config.AutoBlockCustom,
  Callback = function(enabled)
    if suppressCallbacks then return end
    requestBlockToggle(enabled, "custom")
  end,
})
toggles.CustomABModeDropdown = autoBlockTab:Dropdown({
  Title = "Custom Auto Block Mode",
  Values = {"Guest 1337", "007n7"},
  Value = (config.CustomABMode == "007n7") and "007n7" or "Guest 1337",
  Callback = function(selected)
    config.CustomABMode = (selected == "007n7") and "007n7" or "Guest1337"
  end,
})
toggles.ShowDiamond = autoBlockTab:Toggle({
  Title = "Show Diamond Zone",
  Value = config.ShowDiamond,
  Callback = function(enabled)
    if suppressCallbacks then
      config.ShowDiamond = enabled
      refreshCustomZones()
      return
    end
    if config.AutoBlock then
      suppressCallbacks = true
      pcall(function()
        toggles.ShowDiamond:Set(false)
      end)
      suppressCallbacks = false
      config.ShowDiamond = false
      refreshCustomZones()
      return
    end
    config.ShowDiamond = enabled
    refreshCustomZones()
  end,
})
inputs.CustomDiamondLength = autoBlockTab:Input({
  Title = "Diamond Length",
  Value = tostring(config.CustomDiamondLength),
  Placeholder = "8",
  Callback = function(text)
    config.CustomDiamondLength = math.max(1, tonumber(text) or 8)
  end,
})
inputs.CustomDiamondWidth = autoBlockTab:Input({
  Title = "Diamond Width",
  Value = tostring(config.CustomDiamondWidth),
  Placeholder = "4",
  Callback = function(text)
    config.CustomDiamondWidth = math.max(1, tonumber(text) or 4)
  end,
})
inputs.CustomDiamondOffset = autoBlockTab:Input({
  Title = "Diamond Face Offset",
  Value = tostring(config.CustomDiamondOffset),
  Placeholder = "3",
  Callback = function(text)
    config.CustomDiamondOffset = math.max(0, tonumber(text) or 3)
  end,
})
toggles.ShowCircle = autoBlockTab:Toggle({
  Title = "Show Circle Zone",
  Value = config.ShowCircle,
  Callback = function(enabled)
    if suppressCallbacks then
      config.ShowCircle = enabled
      refreshCustomZones()
      return
    end
    if config.AutoBlock then
      suppressCallbacks = true
      pcall(function()
        toggles.ShowCircle:Set(false)
      end)
      suppressCallbacks = false
      config.ShowCircle = false
      refreshCustomZones()
      return
    end
    config.ShowCircle = enabled
    refreshCustomZones()
  end,
})
inputs.CustomCircleRadius = autoBlockTab:Input({
  Title = "Circle Radius",
  Value = tostring(config.CustomCircleRadius),
  Placeholder = "5",
  Callback = function(text)
    config.CustomCircleRadius = math.max(1, tonumber(text) or 5)
  end,
})
inputs.ZoneHeight = autoBlockTab:Input({
  Title = "Zone Height",
  Value = tostring(config.ZoneHeight),
  Placeholder = "0.5",
  Callback = function(text)
    config.ZoneHeight = tonumber(text) or 0.5
  end,
})

local staminaTab = window:Tab({Title = "Stamina", Icon = "zap"})

staminaTab:Section({Title = "Stamina Cheats"})
staminaTab:Toggle({
  Title = "Infinite Stamina",
  Value = false,
  Callback = function(enabled)
    staminaState.InfStamina = enabled
    refreshStamina()
  end,
})
staminaTab:Toggle({
  Title = "Always Sprint",
  Value = false,
  Callback = function(enabled)
    staminaState.AlwaysSprint = enabled
    refreshStamina()
  end,
})
staminaTab:Section({Title = "Info"})
staminaTab:Paragraph({
  Title = "How it works",
  Desc = "Infinite Stamina keeps your stamina bar full every 0.1s and disables stamina loss. Always Sprint forces the sprint state on at all times. Both work for Survivor and Killer roles. The Sprinting module is loaded from the game on first use.",
})

local fovTab = window:Tab({Title = "FOV", Icon = "camera"})

fovTab:Section({Title = "Field of View"})
sliders.FOV = fovTab:Slider({
  Title = "FOV",
  Value = {Min = minFov, Max = maxFov, Default = config.FOVValue},
  Callback = function(value)
    local clamped = math.clamp(math.floor(value), minFov, maxFov)
    if clamped == config.FOVValue then return end
    config.FOVValue = clamped
    scheduleFovApply()
  end,
})
fovTab:Button({
  Title = "Reapply FOV",
  Callback = function()
    applyFov()
  end,
})

local playerInfoTab = window:Tab({Title = "Get ID", Icon = "user"})

playerInfoTab:Section({Title = "Player Info"})
playerDropdown = playerInfoTab:Dropdown({
  Title = "Select player",
  Values = (function()
    local names = {}
    for _, player in ipairs(Players:GetPlayers()) do
      table.insert(names, player.Name)
    end
    return names
  end)(),
  Callback = function(selected)
  end,
})
playerInfoTab:Button({
  Title = "Copy Profile Link",
  Callback = function()
    if not playerDropdown then return end
    local selectedName = playerDropdown.Value
    if not selectedName then return end
    for _, player in ipairs(Players:GetPlayers()) do
      if player.Name == selectedName and setclipboard then
        setclipboard("https://www.roblox.com/users/" .. player.UserId .. "/profile")
      end
    end
  end,
})
playerInfoTab:Button({
  Title = "Refresh List",
  Callback = function()
    if not playerDropdown then return end
    local names = {}
    for _, player in ipairs(Players:GetPlayers()) do
      table.insert(names, player.Name)
    end
    pcall(function()
      playerDropdown:Refresh(names)
    end)
  end,
})

local miscTab = window:Tab({Title = "Misc", Icon = "settings"})

miscTab:Section({Title = "Effects"})
toggles.AntiBlindness = miscTab:Toggle({
  Title = "Anti Blindness",
  Value = config.AntiBlindness,
  Callback = function(enabled)
    config.AntiBlindness = enabled
    if enabled then
      startAntiBlindness()
    else
      stopAntiBlindness()
    end
  end,
})
toggles.AntiGlitch = miscTab:Toggle({
  Title = "Anti Glitch (1x1x1x1)",
  Value = config.AntiGlitch,
  Callback = function(enabled)
    config.AntiGlitch = enabled
    if enabled then
      startAntiGlitch()
    else
      stopAntiGlitch()
    end
  end,
})
toggles.AntiSubspaced = miscTab:Toggle({
  Title = "Anti Subspaced (Taph)",
  Value = config.AntiSubspaced,
  Callback = function(enabled)
    config.AntiSubspaced = enabled
    if enabled then
      startAntiSubspaced()
    else
      stopAntiSubspaced()
    end
  end,
})
toggles.AntiNoliLaugh = miscTab:Toggle({
  Title = "Anti Noli Laugh",
  Value = config.AntiNoliLaugh,
  Callback = function(enabled)
    config.AntiNoliLaugh = enabled
    if enabled then
      startAntiNoliLaugh()
    else
      stopAntiNoliLaugh()
    end
  end,
})

miscTab:Section({Title = "Graphics"})
toggles.LowGraphics = miscTab:Toggle({
  Title = "Low Graphics",
  Value = config.LowGraphics,
  Callback = function(enabled)
    config.LowGraphics = enabled
    if enabled then
      startLowGraphics()
    else
      stopLowGraphics()
    end
  end,
})
toggles.FPSPing = miscTab:Toggle({
  Title = "FPS + Ping",
  Value = config.FPSPing,
  Callback = function(enabled)
    config.FPSPing = enabled
    if enabled then
      startFpsMonitor()
    else
      stopFpsMonitor()
    end
  end,
})

miscTab:Section({Title = "Camera"})
toggles.MaxZoom = miscTab:Toggle({
  Title = "Inf Zoom",
  Value = config.MaxZoom,
  Callback = function(enabled)
    config.MaxZoom = enabled
    if enabled then
      enableMaxZoom()
    else
      disableMaxZoom()
    end
  end,
})
toggles.NoclipCam = miscTab:Toggle({
  Title = "Noclip Cam",
  Value = config.NoclipCam,
  Callback = function(enabled)
    config.NoclipCam = enabled
    if enabled then
      startNoclipCam()
    else
      stopNoclipCam()
    end
  end,
})

miscTab:Section({Title = "Privacy / Chat"})
toggles.ForceChat = miscTab:Toggle({
  Title = "Force Chat",
  Value = config.ForceChat,
  Callback = function(enabled)
    config.ForceChat = enabled
    if enabled then
      startForceChat()
    else
      stopForceChat()
    end
  end,
})
toggles.Disable007n7 = miscTab:Toggle({
  Title = "Disable 007n7 Clone",
  Value = config.Disable007n7,
  Callback = function(enabled)
    config.Disable007n7 = enabled
    if enabled then
      startDisableClone()
    else
      stopDisableClone()
    end
  end,
})
toggles.ShowPrivacy = miscTab:Toggle({
  Title = "Show Privacy",
  Value = config.ShowPrivacy,
  Callback = function(enabled)
    config.ShowPrivacy = enabled
    if enabled then
      startShowPrivacy()
    else
      stopShowPrivacy()
    end
  end,
})

miscTab:Section({Title = "Emergency"})
miscTab:Button({
  Title = "🛑 Disable All",
  Callback = function()
    stopAntiBlindness()
    stopAntiGlitch()
    stopAntiSubspaced()
    stopAntiNoliLaugh()
    stopKillerEsp()
    stopSurvivorEsp()
    stopMinionEsp()
    stopProjectileEsp()
    stopAzureTrapEsp()
    stopAutoBlock()
    stopFourthButton()
    stopCustomZones()
    staminaState.InfStamina = false
    staminaState.AlwaysSprint = false
    stopStaminaLoop()
    stopLowGraphics()
    stopFpsMonitor()
    disableMaxZoom()
    stopNoclipCam()
    stopForceChat()
    stopDisableClone()
    stopShowPrivacy()
    for key, value in pairs(config) do
      if type(value) == "boolean" and key ~= "AimPunch" then
        config[key] = false
      end
    end
    config.ABMode = "Guest1337"
    config.CustomABMode = "Guest1337"
    config.FourthButtonTarget = "default"
    for key, toggle in pairs(toggles) do
      if toggle and config[key] ~= nil then
        suppressCallbacks = true
        pcall(function()
          toggle:Set(config[key])
        end)
        suppressCallbacks = false
      end
    end
    if toggles.ABModeDropdown then
      pcall(function()
        toggles.ABModeDropdown:Set("Guest 1337")
      end)
    end
    if toggles.CustomABModeDropdown then
      pcall(function()
        toggles.CustomABModeDropdown:Set("Guest 1337")
      end)
    end
    if toggles.FourthButtonTargetDropdown then
      pcall(function()
        toggles.FourthButtonTargetDropdown:Set("Default")
      end)
    end
    config.CustomDiamondLength = 8
    config.CustomDiamondWidth = 4
    config.CustomDiamondOffset = 3
    config.CustomCircleRadius = 5
    config.ZoneHeight = 0.5
    rememberedZones.diamond = false
    rememberedZones.circle = false
    syncZoneInputs()
    config.FOVValue = 80
    if sliders.FOV then
      pcall(function()
        sliders.FOV:Set(80)
      end)
    end
    local camera = Workspace.CurrentCamera
    if camera then
      pcall(function()
        camera.FieldOfView = 80
      end)
    end
    print("[testbraken] ⛔ All disabled. FOV reset to 80.")
  end,
})

local configTab = window:Tab({Title = "Config", Icon = "save"})

configTab:Section({Title = "Save / Load / Delete"})
configTab:Button({
  Title = "💾 Save Config",
  Callback = function()
    local saved = saveConfig()
    print(
      "[testbraken] Save:", saved,
      "| AutoBlock:", config.AutoBlock,
      "| Custom:", config.AutoBlockCustom,
      "| ABMode:", config.ABMode,
      "| CustomABMode:", config.CustomABMode,
      "| 4thTarget:", config.FourthButtonTarget,
      "| ShowDia:", config.ShowDiamond,
      "| ShowCir:", config.ShowCircle,
      "| memDia:", rememberedZones.diamond,
      "| memCir:", rememberedZones.circle
    )
  end,
})
configTab:Button({
  Title = "📂 Load Config",
  Callback = function()
    local loaded = loadConfig()
    if not loaded then
      print("[testbraken] No config")
      return
    end
    for key, value in pairs(loaded) do
      if config[key] ~= nil then
        config[key] = value
      end
    end
    for key, toggle in pairs(toggles) do
      if toggle and config[key] ~= nil then
        suppressCallbacks = true
        pcall(function()
          toggle:Set(config[key])
        end)
        suppressCallbacks = false
      end
    end
    if toggles.ABModeDropdown then
      pcall(function()
        toggles.ABModeDropdown:Set(config.ABMode == "007n7" and "007n7" or "Guest 1337")
      end)
    end
    if toggles.CustomABModeDropdown then
      pcall(function()
        toggles.CustomABModeDropdown:Set(config.CustomABMode == "007n7" and "007n7" or "Guest 1337")
      end)
    end
    if toggles.FourthButtonTargetDropdown then
      pcall(function()
        toggles.FourthButtonTargetDropdown:Set(config.FourthButtonTarget == "custom" and "Custom" or "Default")
      end)
    end
    if sliders.FOV then
      pcall(function()
        sliders.FOV:Set(config.FOVValue)
      end)
    end
    syncZoneInputs()
    if config.AntiBlindness then startAntiBlindness() else stopAntiBlindness() end
    if config.AntiGlitch then startAntiGlitch() else stopAntiGlitch() end
    if config.AntiSubspaced then startAntiSubspaced() else stopAntiSubspaced() end
    if config.AntiNoliLaugh then startAntiNoliLaugh() else stopAntiNoliLaugh() end
    if config.MinionESP then startMinionEsp() else stopMinionEsp() end
    if config.ProjectileESP then startProjectileEsp() else stopProjectileEsp() end
    if config.AzureTrapESP then startAzureTrapEsp() else stopAzureTrapEsp() end
    if config.AutoBlock or config.AutoBlockCustom then startAutoBlock() else stopAutoBlock() end
    enforceBlockModeExclusivity()
    if config.AutoBlockButton then startFourthButton() else stopFourthButton() end
    if config.LowGraphics then startLowGraphics() else stopLowGraphics() end
    if config.FPSPing then startFpsMonitor() else stopFpsMonitor() end
    if config.MaxZoom then enableMaxZoom() else disableMaxZoom() end
    if config.NoclipCam then startNoclipCam() else stopNoclipCam() end
    if config.ForceChat then startForceChat() else stopForceChat() end
    if config.Disable007n7 then startDisableClone() else stopDisableClone() end
    if config.ShowPrivacy then startShowPrivacy() else stopShowPrivacy() end
    applyFov()
    if fourthButtonState.applyTint then
      fourthButtonState.applyTint()
    end
    print(
      "[testbraken] Config loaded (AutoBlock:", config.AutoBlock,
      "| Custom:", config.AutoBlockCustom,
      "| ABMode:", config.ABMode,
      "| CustomABMode:", config.CustomABMode,
      "| Diamond:", config.CustomDiamondLength .. "x" .. config.CustomDiamondWidth,
      "| Circle:", config.CustomCircleRadius,
      "| memDia:", rememberedZones.diamond,
      "| memCir:", rememberedZones.circle,
      ")"
    )
  end,
})
configTab:Button({
  Title = "🗑 Delete Config",
  Callback = function()
    local deleted = deleteConfig()
    print("[testbraken] Delete:", deleted)
  end,
})

if config.AntiBlindness then
  startAntiBlindness()
end

task.spawn(function()
  task.wait(1.0)
  local loaded = loadConfig()
  if loaded then
    for key, value in pairs(loaded) do
      if config[key] ~= nil then
        config[key] = value
      end
    end
    if config.AntiBlindness then startAntiBlindness() else stopAntiBlindness() end
    if config.AntiGlitch then startAntiGlitch() end
    if config.AntiSubspaced then startAntiSubspaced() end
    if config.AntiNoliLaugh then startAntiNoliLaugh() end
    if config.MinionESP then startMinionEsp() end
    if config.ProjectileESP then startProjectileEsp() end
    if config.AzureTrapESP then startAzureTrapEsp() end
    if config.AutoBlock or config.AutoBlockCustom then startAutoBlock() end
    enforceBlockModeExclusivity()
    if config.AutoBlockButton then startFourthButton() end
    if config.LowGraphics then startLowGraphics() end
    if config.FPSPing then startFpsMonitor() end
    if config.MaxZoom then enableMaxZoom() end
    if config.NoclipCam then startNoclipCam() end
    if config.ForceChat then startForceChat() end
    if config.Disable007n7 then startDisableClone() end
    if config.ShowPrivacy then startShowPrivacy() end
    applyFov()
    for key, toggle in pairs(toggles) do
      if toggle and config[key] ~= nil then
        suppressCallbacks = true
        pcall(function()
          toggle:Set(config[key])
        end)
        suppressCallbacks = false
      end
    end
    if toggles.ABModeDropdown then
      pcall(function()
        toggles.ABModeDropdown:Set(config.ABMode == "007n7" and "007n7" or "Guest 1337")
      end)
    end
    if toggles.CustomABModeDropdown then
      pcall(function()
        toggles.CustomABModeDropdown:Set(config.CustomABMode == "007n7" and "007n7" or "Guest 1337")
      end)
    end
    if toggles.FourthButtonTargetDropdown then
      pcall(function()
        toggles.FourthButtonTargetDropdown:Set(config.FourthButtonTarget == "custom" and "Custom" or "Default")
      end)
    end
    if sliders.FOV then
      pcall(function()
        sliders.FOV:Set(config.FOVValue)
      end)
    end
    syncZoneInputs()
    if fourthButtonState.applyTint then
      fourthButtonState.applyTint()
    end
    print(
      "[testbraken] Auto-loaded config (AutoBlock:", config.AutoBlock,
      "| Custom:", config.AutoBlockCustom,
      "| ABMode:", config.ABMode,
      "| CustomABMode:", config.CustomABMode,
      "| Diamond:", config.CustomDiamondLength .. "x" .. config.CustomDiamondWidth,
      "| Circle:", config.CustomCircleRadius,
      "| memDia:", rememberedZones.diamond,
      "| memCir:", rememberedZones.circle,
      ")"
    )
  end
end)

if config.AutoBlockButton then
  startFourthButton()
end

refreshCustomZones()

Players.PlayerAdded:Connect(function()
  task.defer(function()
    if playerDropdown then
      local names = {}
      for _, player in ipairs(Players:GetPlayers()) do
        table.insert(names, player.Name)
      end
      pcall(function()
        playerDropdown:Refresh(names)
      end)
    end
  end)
end)

Players.PlayerRemoving:Connect(function()
  task.defer(function()
    if playerDropdown then
      local names = {}
      for _, player in ipairs(Players:GetPlayers()) do
        table.insert(names, player.Name)
      end
      pcall(function()
        playerDropdown:Refresh(names)
      end)
    end
  end)
end)

print("[testbraken] v9.1.1 Loaded")
Executor compatibility changes over time. Check current reports before testing.

Script #20 Use in round not in lobby & More

Script #20 · Use in round not in lobby & MoreFree
Use in round not in lobby
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local MainKillersPath = ReplicatedStorage.Assets.Killers
local IngamePlayers = workspace.Players
local Spectators = IngamePlayers.Spectating
local Method = '1x1x1x1 Zombie' -- or can be "c00lkidd Minion"
assert(Method == '1x1x1x1 Zombie' or Method == 'c00lkidd Minion', 'Invalid invis method. Use either 1x1x1x1 Zombie or c00lkidd Minion')
local ZombieSummon
local MinionSummon
local LocalPlayer = game:GetService('Players').LocalPlayer
local Success, AnimId = xpcall(function()
    ZombieSummon = require(MainKillersPath['1x1x1x1'].Config).ZombieAnimations.Summon
    MinionSummon = require(MainKillersPath['c00lkidd'].Config).PizzaDeliveryAnimations.Summoned
end, function(err)
    warn('Failed to load animation ID for invisibility due to:', err)
end)
if not MinionSummon then
    MinionSummon = 'rbxassetid://18886065814'
end
if not ZombieSummon then
    ZombieSummon = 'rbxassetid://75804462760596'
end
local CharacterAdded
local function SetupInvis(Char)
    local AnimId = Method == '1x1x1x1 Zombie' and ZombieSummon or MinionSummon
    if not Animation then
        getgenv().Animation = Instance.new('Animation')
        Animation.AnimationId = AnimId
    end
    getgenv().AnimTrack = Char.Humanoid:LoadAnimation(Animation)
    AnimTrack:Play()
    AnimTrack:AdjustSpeed(0)
    AnimTrack.TimePosition = 0
end
_G.InvisEnabled = not _G.InvisEnabled
if _G.InvisEnabled then
    getgenv().Waiting = task.spawn(function()
        local Char = LocalPlayer.Character
        if Char and Char.Parent ~= Spectators then
            if not Char:WaitForChild('Humanoid', 10) then
                return warn('Invis: No humanoid')
            end
            SetupInvis(Char)
        end
    end)
    getgenv().InvisCharacterAdded = LocalPlayer.CharacterAdded:Connect(function(Char)
        if Char.Parent ~= Spectators then
            if not Char:WaitForChild('Humanoid', 10) then
                return warn('Invis: No humanoid')
            end
            SetupInvis(Char)
        end
    end)
else
    if Waiting then
        getgenv().Waiting = task.cancel(Waiting)
    end
    if InvisCharacterAdded then
        getgenv().InvisCharacterAdded = InvisCharacterAdded:Disconnect()
    end
    if Animation then
        getgenv().Animation = Animation:Destroy()
    end
    if AnimTrack then
        getgenv().AnimTrack = AnimTrack:Stop()
    end
end
Executor compatibility changes over time. Check current reports before testing.

Script #21 Infinite Stamina, & More

Script #21 · Infinite Stamina, & MoreFree
Infinite Stamina,Auto Generator,Infinite Bloxy Cola,ESP,Universal Killer Walls,Guest Auto Block
loadstring(game:HttpGet('https://raw.githubusercontent.com/BBro2137/KulkiGUI/refs/heads/main/KulkiGUI.luau'))()
Executor compatibility changes over time. Check current reports before testing.

Script #22 Forsaken Macro, Survivor & Killer Bot & More (works well Update)

Script #22 · Forsaken Macro, Survivor & Killer Bot & MoreFree
Forsaken Macro, Survivor & Killer BotFeaturesKiller: Chases players and uses attacks and abilities.Generator puzzles: Handles all 4 puzzles.ControlsF6: Turn the bot on or pause it.
loadstring(game:HttpGet("https://pastebin.com/raw/7VapddzZ"))()
Executor compatibility changes over time. Check current reports before testing.

Script #23 Lunar Hub

Script #23 · Lunar HubFree
Lunar Hub | ForsakenBase SpeedApply SpeedLoad Recommended statsLoad Blatant StatsReset Settings
loadstring(game:HttpGet("https://flowauth.net/v1/loaders/b54f1d42ca1b3597aa5ddd246f7109e5.lua"))()
Executor compatibility changes over time. Check current reports before testing.

Script #24 Generator ESP with Progress & More

Script #24 · Generator ESP with Progress & MoreFree
Generator ESP with Progress
loadstring(game:HttpGet("https://raw.githubusercontent.com/ManiacTheeBarescriptor/Forsaken/refs/heads/main/UniversalGenESPV2.Deus.lua"))()
Executor compatibility changes over time. Check current reports before testing.

Script #25 Auto Hits the skill check for you chuds & More

Script #25 · Auto Hits the skill check for you chuds & MoreFree
Auto Hits the skill check for you chuds
local typeof_ = (type(typeof) == "function" and typeof) or type
local now = (type(time) == "function" and time) or os.clock
local getconnections_ = getconnections
local getgenv_ = getgenv
local shared_ = shared

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer

local registry = (type(getgenv_) == "function" and getgenv_())
    or (type(shared_) == "table" and shared_)
    or _G

local KEY = "__Split_AutoTrick_Controller_v1__"
local existing = registry[KEY]
if type(existing) == "table" and type(existing.IsInstalled) == "function"
    and existing.IsInstalled() then
    existing.SetEnabled(true)
    return existing
end

local settings = {
    Cooldown = 1.1,
    ReleaseDelay = 0.05,
    ResolveRetry = 0.25,
    ErrorRetry = 0.5,
}

local enabled, installed = true, false
local unavailable = nil
local lastTrick = -math.huge
local nextAt = { sprinting = 0, actors = 0, trick = 0 }
local cache = { sprinting = nil, actors = nil, button = nil, down = nil, up = nil }
local heartbeat = nil
local warned = {}

local function warnOnce(key, message)
    if warned[key] then return end
    warned[key] = true
    print("[auto_trick] " .. key .. ": " .. tostring(message))
end

local function child(parent, name)
    if not parent then return nil end
    return parent:FindFirstChild(name)
end

local function safeRequire(module)
    local ok, value = pcall(require, module)
    if not ok or type(value) ~= "table" then return nil, tostring(value) end
    return value
end

local function resolveSprinting(t)
    if cache.sprinting then return cache.sprinting end
    if t < nextAt.sprinting then return nil end
    local systems = child(ReplicatedStorage, "Systems")
    local character = child(systems, "Character")
    local gameplay = child(character, "Game")
    local module = child(gameplay, "Sprinting")
    if not module then
        nextAt.sprinting = t + settings.ResolveRetry
        return nil
    end
    local value, err = safeRequire(module)
    if not value then
        nextAt.sprinting = t + settings.ErrorRetry
        warnOnce("sprinting", "Sprinting require failed: " .. tostring(err))
        return nil
    end
    cache.sprinting = value
    return value
end

local function resolveActors(t)
    if cache.actors then return cache.actors end
    if t < nextAt.actors then return nil end
    local modules = child(ReplicatedStorage, "Modules")
    local gameplay = child(modules, "Gameplay")
    local module = child(gameplay, "Actors")
    if not module then
        nextAt.actors = t + settings.ResolveRetry
        return nil
    end
    local value, err = safeRequire(module)
    if not value then
        nextAt.actors = t + settings.ErrorRetry
        warnOnce("actors", "Actors require failed: " .. tostring(err))
        return nil
    end
    cache.actors = value
    return value
end

local function active()
    return enabled and installed
end

local function fire(signal)
    if not signal or type(getconnections_) ~= "function" then return end
    for _, connection in pairs(getconnections_(signal)) do
        if connection and connection.Connected ~= false
            and connection.Enabled ~= false then
            if type(connection.Fire) == "function" then
                pcall(connection.Fire, connection)
            elseif type(connection.Function) == "function" then
                pcall(connection.Function)
            end
        end
    end
end

local function release(sprinting, button)
    pcall(function()
        if not active() then return end
        if sprinting.MobileButton ~= button then return end
        fire(cache.up)
    end)
end

local function tryTrick(t)
    local sprinting = resolveSprinting(t)
    local actors = resolveActors(t)
    if not sprinting or not actors then return end

    local button = sprinting.MobileButton
    if not button or not button.Parent then
        nextAt.trick = t + settings.ResolveRetry
        return
    end
    if cache.button ~= button then
        cache.button = button
        cache.down = button.MouseButton1Down
        cache.up = button.MouseButton1Up
    end

    local actor = actors.CurrentActors and actors.CurrentActors[player]
    if not actor or not actor.State or not actor.State.isSkating then return end
    local highlight = actor.Instances and actor.Instances.Sk8Highlight
    if not highlight or not highlight.Adornee then return end

    lastTrick = t
    fire(cache.down)
    task.delay(settings.ReleaseDelay, release, sprinting, button)
end

local controller = { Settings = settings }

function controller.IsEnabled()
    return enabled
end

function controller.IsInstalled()
    return installed
end

function controller.SetEnabled(value)
    enabled = not not value
    if not enabled then lastTrick = -math.huge end
end

function controller.SetCooldown(value)
    assert(typeof_(value) == "number" and value > 0, "cooldown must be > 0")
    settings.Cooldown = value
end

function controller.Status()
    return {
        Installed = installed,
        Enabled = enabled,
        Unavailable = unavailable,
        Cooldown = settings.Cooldown,
        ReleaseDelay = settings.ReleaseDelay,
        Modules = {
            Sprinting = cache.sprinting ~= nil,
            Actors = cache.actors ~= nil,
        },
    }
end

function controller.Stop()
    installed = false
    enabled = false
    unavailable = nil
    if heartbeat then
        heartbeat:Disconnect()
        heartbeat = nil
    end
    lastTrick = -math.huge
    nextAt.sprinting, nextAt.actors, nextAt.trick = 0, 0, 0
    cache.sprinting, cache.actors = nil, nil
    cache.button, cache.down, cache.up = nil, nil, nil
    registry[KEY] = nil
end

function controller.Restart()
    if installed then return true end
    enabled = true
    lastTrick = -math.huge
    return controller._install()
end

function controller._install()
    if type(getconnections_) ~= "function" then
        unavailable = "getconnections unavailable"
        warnOnce("autotrick", unavailable)
    else
        heartbeat = RunService.Heartbeat:Connect(function()
            if not active() then return end
            local t = now()
            if t - lastTrick < settings.Cooldown then return end
            if t < nextAt.trick then return end
            local ok, failure = pcall(tryTrick, t)
            if not ok then
                nextAt.trick = t + settings.ErrorRetry
                lastTrick = t - settings.Cooldown
                warnOnce("autotrick", "trick failed: " .. tostring(failure))
            end
        end)
        unavailable = nil
    end
    installed = true
    registry[KEY] = controller
    return true
end

assert(controller._install(), "failed to install auto trick")
return controller
Executor compatibility changes over time. Check current reports before testing.

Script #26 Working Script

Script #26 · Working ScriptFree
loadstring(game:HttpGet("https://raw.githubusercontent.com/LolnotaKid/project/refs/heads/main/AutoBLOCKKKWAHV1"))()
Executor compatibility changes over time. Check current reports before testing.

Script #27 By Gemini 3.8 Flash & More

Script #27 · By Gemini 3.8 Flash & MoreFree
By Gemini 3.8 Flash
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Lighting = game:GetService("Lighting")
local VirtualInputManager = game:GetService("VirtualInputManager")
local ProximityPromptService = game:GetService("ProximityPromptService")
local TeleportService = game:GetService("TeleportService")
local CoreGui = game:GetService("CoreGui")

local LocalPlayer = Players.LocalPlayer
local Camera = workspace.CurrentCamera

if getgenv().ForsakenCleanup then
    pcall(getgenv().ForsakenCleanup)
end

local Running = true
local Connections = {}
local Highlights = {}
local Billboards = {}
local GeneratorCache = {}
local GearCache = {}
local TrapCache = {}
local ItemCache = {}
local ActivePromptCache = {}

local OriginalLighting = {
    Ambient = Lighting.Ambient,
    OutdoorAmbient = Lighting.OutdoorAmbient,
    Brightness = Lighting.Brightness,
    ClockTime = Lighting.ClockTime,
    FogEnd = Lighting.FogEnd,
    GlobalShadows = Lighting.GlobalShadows,
}

local function TrackConnection(conn)
    table.insert(Connections, conn)
    return conn
end

local State = {
    -- Movement & Sprint
    AutoSprint = false,
    InfiniteStamina = false,
    ForcedJump = true,
    JumpPower = 50,
    InfiniteJump = false,
    AntiSlow = false,

    -- Combat & Defense
    AutoBlock = false,
    AutoBlockRange = 14,
    AutoAvoidKiller = false,
    AutoAvoidKillerRange = 16,
    AvoidRepelForce = 70,
    Triggerbot = false,
    TriggerbotRange = 14,
    TriggerbotCooldown = 0.35,

    -- Visuals / ESP
    ESPEnabled = true,
    SurvivorsESP = true,
    KillersESP = true,
    GeneratorsESP = true,
    GearsESP = true,
    TrapsESP = true,
    ItemsESP = true,
    ChamsEnabled = true,
    KillerAlert = true,
    KillerAlertDistance = 75,
    Fullbright = false,
    CustomFOV = 70,
    RemoveVFX = false,

    -- Automation & Interacts
    AutoAllPuzzles = true,
    InstantInteract = true,
    AutoProximityInteract = false,
    ProximitySpoofRange = false,
}

-- Pre-load and cache game modules once
local SprintingModule = nil
local GeneratorClientBinder = nil
local GearClientBinder = nil
local LockClientMinigame = nil
local FlowClientMinigame = nil
local ConnectClientMinigame = nil
local GearClientMinigame = nil
local MinigameController = nil
local FlowBoard = nil
local ConnectBoard = nil

local function LoadModules()
    pcall(function() SprintingModule = require(ReplicatedStorage.Systems.Character.Game.Sprinting) end)
    pcall(function() GeneratorClientBinder = require(ReplicatedStorage.Systems.Player.Game.Generators.GeneratorClientBinder) end)
    pcall(function() GearClientBinder = require(ReplicatedStorage.Systems.Player.Game.Spawners.GearClientBinder) end)
    pcall(function() LockClientMinigame = require(ReplicatedStorage.Systems.Player.Game.Minigames.LockClientMinigame) end)
    pcall(function() FlowClientMinigame = require(ReplicatedStorage.Systems.Player.Game.Minigames.FlowClientMinigame) end)
    pcall(function() ConnectClientMinigame = require(ReplicatedStorage.Systems.Player.Game.Minigames.ConnectClientMinigame) end)
    pcall(function() GearClientMinigame = require(ReplicatedStorage.Systems.Player.Game.Minigames.GearClientMinigame) end)
    pcall(function() MinigameController = require(ReplicatedStorage.Systems.Player.MinigameController) end)
    pcall(function() FlowBoard = require(ReplicatedStorage.Modules.Minigames.FlowBoard) end)
    pcall(function() ConnectBoard = require(ReplicatedStorage.Modules.Minigames.ConnectBoard) end)
end
LoadModules()

local GeneratorBinderRunning = nil
local function UpdateBinderRunningCache()
    if GeneratorClientBinder then
        for k, v in pairs(GeneratorClientBinder) do
            if tostring(k):find("Running") and type(v) == "table" then
                GeneratorBinderRunning = v
                break
            end
        end
    end
end
UpdateBinderRunningCache()

-- Load Rayfield UI Library
local Rayfield = loadstring(game:HttpGet("https://sirius.menu/rayfield"))()

local function Notify(title, content, duration)
    pcall(function()
        Rayfield:Notify({
            Title = title or "Forsaken",
            Content = content or "",
            Duration = duration or 3,
            Image = 4483362458,
        })
    end)
end

-- =========================================================================
-- MAP ELEMENT CACHES & PROGRESS HELPERS
-- =========================================================================
local GenBarCache = {}
local GenValCache = {}

local function GetGeneratorProgress(gen)
    if not gen then return 0 end

    if GeneratorBinderRunning then
        local obj = GeneratorBinderRunning[gen]
        if obj then
            if obj.__getFraction then
                local s, frac = pcall(function() return obj:__getFraction() end)
                if s and type(frac) == "number" then
                    return math.clamp(math.floor(frac * 100), 0, 100)
                end
            end
            if obj.Network and obj.Network.Properties then
                local props = obj.Network.Properties
                local s1, c = pcall(function() return props:Get("Counter") end)
                local s2, m = pcall(function() return props:Get("MaxCounter") end)
                if s1 and s2 and type(c) == "number" and type(m) == "number" and m > 0 then
                    return math.clamp(math.floor((c / m) * 100), 0, 100)
                end
            end
        end
    else
        UpdateBinderRunningCache()
    end

    local bar = GenBarCache[gen]
    if bar == nil then
        bar = gen:FindFirstChild("Bar", true) or false
        GenBarCache[gen] = bar
    end
    if bar and bar:IsA("GuiObject") then
        local scale = bar.Size.X.Scale
        if scale > 0 and scale <= 1 then
            return math.clamp(math.floor(scale * 100), 0, 100)
        end
    end

    local attrVal = gen:GetAttribute("Progress") or gen:GetAttribute("Counter") or gen:GetAttribute("RepairProgress")
    if type(attrVal) == "number" then
        if attrVal <= 1 then return math.clamp(math.floor(attrVal * 100), 0, 100) end
        return math.clamp(math.floor(attrVal), 0, 100)
    end

    local pv = GenValCache[gen]
    if pv == nil then
        pv = gen:FindFirstChild("Progress") or false
        GenValCache[gen] = pv
    end
    if pv and pv:IsA("NumberValue") then
        local v = pv.Value
        if v <= 1 and v > 0 then return math.clamp(math.floor(v * 100), 0, 100) end
        return math.clamp(math.floor(v), 0, 100)
    end

    return 0
end

local function IsObjectPresent(inst, part)
    if not inst or not inst.Parent or not part or not part.Parent then
        return false
    end
    if not inst:IsDescendantOf(workspace) or not part:IsDescendantOf(workspace) then
        return false
    end

    local playersFolder = workspace:FindFirstChild("Players")
    if playersFolder and (inst:IsDescendantOf(playersFolder) or inst:FindFirstAncestor("Players")) then
        return false
    end

    local lobby = workspace:FindFirstChild("Lobby")
    if lobby and (inst:IsDescendantOf(lobby) or part:IsDescendantOf(lobby)) then
        return false
    end
    local waitingRoom = workspace:FindFirstChild("WaitingRoom")
    if waitingRoom and (inst:IsDescendantOf(waitingRoom) or part:IsDescendantOf(waitingRoom)) then
        return false
    end

    local prompt = inst:FindFirstChildWhichIsA("ProximityPrompt") or inst:FindFirstChild("Prompt", true) or part:FindFirstChildWhichIsA("ProximityPrompt")
    if prompt and not prompt.Enabled then
        return false
    end

    if part:IsA("BasePart") and part.Transparency < 0.85 then
        return true
    end
    if inst:IsA("Model") then
        for _, child in ipairs(inst:GetChildren()) do
            if child:IsA("BasePart") and child.Transparency < 0.85 then
                return true
            end
        end
    end

    return false
end

local function RegisterGenerator(inst)
    if not inst or not inst:IsA("Model") then return end
    local n = inst.Name:lower()
    if not (n:find("generator") or inst:FindFirstChild("Progress")) then return end

    local parent = inst.Parent
    if parent and parent:IsA("Model") and (parent.Name:lower():find("generator") or parent:FindFirstChild("Progress")) then
        return
    end

    local lobby = workspace:FindFirstChild("Lobby")
    if lobby and inst:IsDescendantOf(lobby) then return end

    local main = inst:FindFirstChild("Main") or inst.PrimaryPart or inst:FindFirstChildWhichIsA("BasePart")
    if main then
        for existingGen, existingPart in pairs(GeneratorCache) do
            if existingGen == inst or existingPart == main or (existingPart.Position - main.Position).Magnitude < 8 then
                return
            end
        end
        GeneratorCache[inst] = main
    end
end

local function RegisterGear(inst)
    if not inst or (not inst:IsA("Model") and not inst:IsA("BasePart")) then return end
    local n = inst.Name:lower()
    if n:find("spawner") or n:find("spawn") or n:find("gearbox") or n:find("furniture") or n:find("mesh") or n:find("node") or n:find("point") then
        return
    end

    local lobby = workspace:FindFirstChild("Lobby")
    if lobby and inst:IsDescendantOf(lobby) then return end

    if n:find("gear") or n:find("cog") then
        local part = inst:IsA("BasePart") and inst or (inst.PrimaryPart or inst:FindFirstChildWhichIsA("BasePart"))
        if part then
            GearCache[inst] = part
        end
    end
end

local function RegisterTrap(inst)
    if not inst or (not inst:IsA("Model") and not inst:IsA("BasePart")) then return end

    local lobby = workspace:FindFirstChild("Lobby")
    if lobby and (inst:IsDescendantOf(lobby) or inst:FindFirstAncestor("Lobby")) then return end
    local waitingRoom = workspace:FindFirstChild("WaitingRoom")
    if waitingRoom and (inst:IsDescendantOf(waitingRoom) or inst:FindFirstAncestor("WaitingRoom")) then return end

    local n = inst.Name:lower()
    if n:find("trapezoid") or n:find("stud") or n:find("mesh") or n:find("wedge") or n:find("roof")
       or n:find("decor") or n:find("building") or n:find("furniture") or n:find("wall") or n:find("floor")
       or n:find("strap") or n:find("trapdoor") or n:find("scarybear") or n:find("happybear") or n:find("railing")
       or n:find("beam") or n:find("support") or n:find("tower") or n:find("wood") or n:find("plank") then
        return
    end

    local isTrap = false
    if n:find("beartrap") or n:find("tripwire") or n:find("tripmine") or n:find("snare") then
        isTrap = true
    elseif n == "trap" or n:find("^trap") or n:find("_trap") or n:find("trap_") or n:find(" killer trap") or n:find("killertrap") then
        isTrap = true
    elseif n:find("mine") and not n:find("minigame") and not n:find("reminis") and not n:find("mineral") and not n:find("determine") then
        isTrap = true
    end

    if isTrap then
        local part = inst:IsA("BasePart") and inst or (inst:FindFirstChildWhichIsA("BasePart") or inst.PrimaryPart)
        if part then
            TrapCache[inst] = part
        end
    end
end

local function RegisterItem(inst)
    if not inst or (not inst:IsA("Model") and not inst:IsA("BasePart")) then return end

    local playersFolder = workspace:FindFirstChild("Players")
    if playersFolder and (inst:IsDescendantOf(playersFolder) or inst:FindFirstAncestor("Players")) then
        return
    end

    local lobby = workspace:FindFirstChild("Lobby")
    if lobby and inst:IsDescendantOf(lobby) then return end
    local waitingRoom = workspace:FindFirstChild("WaitingRoom")
    if waitingRoom and inst:IsDescendantOf(waitingRoom) then return end

    local n = inst.Name:lower()
    if n:find("mesh") or n:find("crate_cube") or n:find("flatcrate") or n:find("furniture")
       or n:find("wall") or n:find("door") or n:find("floor") or n:find("light") or n:find("window")
       or n:find("shelf") or n:find("carpet") or n:find("table") or n:find("chair") or n:find("decor")
       or n:find("building") or n:find("prop") or n:find("spawner") or n:find("spawn") or n:find("point") or n:find("node") then
        return
    end

    if n:find("gear") or n:find("cog") or n:find("generator") or n:find("trap") then
        return
    end

    local prompt = inst:FindFirstChildWhichIsA("ProximityPrompt") or inst:FindFirstChild("Prompt", true) or (inst.Parent and inst.Parent:FindFirstChildWhichIsA("ProximityPrompt"))
    local isRealItem = false
    local itemName = inst.Name

    if prompt and prompt:IsA("ProximityPrompt") then
        local at = (prompt.ActionText or ""):lower()
        local ot = (prompt.ObjectText or ""):lower()

        if at:find("pick") or at:find("take") or at:find("grab") or at:find("collect") or at:find("loot") or at:find("search") or at:find("open") then
            if not ot:find("door") and not ot:find("generator") and not ot:find("locker") and not ot:find("gate") and not ot:find("puzzle") then
                isRealItem = true
                if prompt.ObjectText and prompt.ObjectText ~= "" then
                    itemName = prompt.ObjectText
                end
            end
        elseif ot:find("medkit") or ot:find("battery") or ot:find("key") or ot:find("flashlight") or ot:find("item") or ot:find("crowbar") then
            isRealItem = true
            itemName = prompt.ObjectText
        end
    end

    if not isRealItem and (inst:IsA("Tool") or (inst.Parent and inst.Parent:IsA("Tool"))) then
        isRealItem = true
        itemName = inst:IsA("Tool") and inst.Name or inst.Parent.Name
    end

    if isRealItem then
        local lowerName = itemName:lower()
        if lowerName:find("mesh") or lowerName:find("crate_cube") or lowerName:find("flatcrate") or lowerName:find("prop") then
            return
        end

        local part = inst:IsA("BasePart") and inst or (inst.PrimaryPart or inst:FindFirstChildWhichIsA("BasePart"))
        if part then
            ItemCache[inst] = { Part = part, Name = itemName }
        end
    end
end

local function UnregisterInstance(inst)
    GeneratorCache[inst] = nil
    GearCache[inst] = nil
    TrapCache[inst] = nil
    ItemCache[inst] = nil
    if Billboards[inst] then
        if Billboards[inst].Gui and Billboards[inst].Gui.Parent then
            Billboards[inst].Gui:Destroy()
        end
        Billboards[inst] = nil
    end
    if Highlights[inst] then
        if Highlights[inst].Parent then
            Highlights[inst]:Destroy()
        end
        Highlights[inst] = nil
    end
end

pcall(function()
    for _, child in ipairs(workspace:GetDescendants()) do
        RegisterGenerator(child)
        RegisterGear(child)
        RegisterTrap(child)
        RegisterItem(child)
    end
end)

local MapFolder = workspace:FindFirstChild("Map")
if MapFolder then
    TrackConnection(MapFolder.DescendantAdded:Connect(function(child)
        RegisterGenerator(child)
        RegisterGear(child)
        RegisterTrap(child)
        RegisterItem(child)
    end))
    TrackConnection(MapFolder.DescendantRemoving:Connect(function(child)
        UnregisterInstance(child)
    end))
end

TrackConnection(workspace.DescendantAdded:Connect(function(child)
    RegisterTrap(child)
    RegisterItem(child)
end))
TrackConnection(workspace.DescendantRemoving:Connect(function(child)
    if TrapCache[child] then
        UnregisterInstance(child)
    end
end))

-- =========================================================================
-- SMART AVOID VECTOR & MANUAL IMPULSE
-- =========================================================================
local AvoidRayParams = RaycastParams.new()
AvoidRayParams.FilterType = Enum.RaycastFilterType.Exclude
AvoidRayParams.IgnoreWater = true

local function GetSmartAvoidVector(myHRP, kHRP)
    local myPos = myHRP.Position
    local kPos = kHRP.Position
    local diff = myPos - kPos
    local awayFlat = Vector3.new(diff.X, 0, diff.Z)
    if awayFlat.Magnitude > 0.001 then
        awayFlat = awayFlat.Unit
    else
        local look = myHRP.CFrame.LookVector
        awayFlat = Vector3.new(-look.X, 0, -look.Z)
        awayFlat = (awayFlat.Magnitude > 0.001) and awayFlat.Unit or Vector3.new(0, 0, 1)
    end

    local myChar = LocalPlayer.Character
    local filterList = { myChar }
    local playersRoot = workspace:FindFirstChild("Players")
    if playersRoot then
        table.insert(filterList, playersRoot)
    end
    AvoidRayParams.FilterDescendantsInstances = filterList

    local rayOrigin = myPos + Vector3.new(0, -0.4, 0)
    local maxCheckDist = 12.0

    local directRay = workspace:Raycast(rayOrigin, awayFlat * maxCheckDist, AvoidRayParams)
    if not directRay or directRay.Distance >= 8.5 then
        return awayFlat, 1.5
    end

    local escapeAngles = { 40, -40, 75, -75, 105, -105, 135, -135 }
    local bestDir = awayFlat
    local directDist = directRay and directRay.Distance or maxCheckDist
    local bestScore = (directDist * 1.5) + 4.0
    local bestDist = directDist

    local ax, az = awayFlat.X, awayFlat.Z

    for _, deg in ipairs(escapeAngles) do
        local rad = math.rad(deg)
        local cosA, sinA = math.cos(rad), math.sin(rad)
        local candDir = Vector3.new(ax * cosA - az * sinA, 0, ax * sinA + az * cosA).Unit
        local ray = workspace:Raycast(rayOrigin, candDir * maxCheckDist, AvoidRayParams)
        local dist = ray and ray.Distance or maxCheckDist
        local dot = candDir.X * ax + candDir.Z * az

        local score = (dist * 1.8) + (dot * 5.0)
        if dist < 3.2 then
            score = score - 14.0
        end

        if score > bestScore then
            bestScore = score
            bestDir = candDir
            bestDist = dist
        end
    end

    local upBoost = (bestDist < 3.2) and 18 or 2.0
    return bestDir, upBoost
end

local function ExecuteAvoidImpulse()
    local myChar = LocalPlayer.Character
    local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")
    if not myHRP then return end

    local killersFolder = workspace:FindFirstChild("Players") and workspace.Players:FindFirstChild("Killers")
    local closestDist, closestKiller = 999999, nil
    if killersFolder then
        for _, k in ipairs(killersFolder:GetChildren()) do
            local kHRP = k:FindFirstChild("HumanoidRootPart")
            if kHRP then
                local d = (kHRP.Position - myHRP.Position).Magnitude
                if d < closestDist then
                    closestDist = d
                    closestKiller = kHRP
                end
            end
        end
    end

    local avoidDir, upBoost
    if closestKiller then
        avoidDir, upBoost = GetSmartAvoidVector(myHRP, closestKiller)
    else
        local look = myHRP.CFrame.LookVector
        local awayFlat = Vector3.new(-look.X, 0, -look.Z)
        awayFlat = (awayFlat.Magnitude > 0.001) and awayFlat.Unit or Vector3.new(0, 0, 1)
        local fakeKiller = { Position = myHRP.Position - awayFlat * 10 }
        avoidDir, upBoost = GetSmartAvoidVector(myHRP, fakeKiller)
    end

    myHRP.AssemblyLinearVelocity = avoidDir * (State.AvoidRepelForce * 1.25) + Vector3.new(0, math.max(upBoost, 16), 0)
    Notify("Auto Avoid", "Импульс отскока активирован!", 1.5)
end

-- =========================================================================
-- PROXIMITY PROMPT & FAST INTERACTION SYSTEM
-- =========================================================================
local function ApplyPromptSettings(prompt)
    if not prompt or not prompt:IsA("ProximityPrompt") then return end
    if not prompt:GetAttribute("OrigHold") then
        prompt:SetAttribute("OrigHold", prompt.HoldDuration)
        prompt:SetAttribute("OrigDist", prompt.MaxActivationDistance)
        prompt:SetAttribute("OrigLOS", prompt.RequiresLineOfSight)
    end

    if State.InstantInteract then
        prompt.HoldDuration = 0
    else
        local orig = prompt:GetAttribute("OrigHold")
        if orig ~= nil then prompt.HoldDuration = orig end
    end

    if State.ProximitySpoofRange then
        prompt.MaxActivationDistance = 30
        prompt.RequiresLineOfSight = false
    else
        local origDist = prompt:GetAttribute("OrigDist")
        if origDist ~= nil then prompt.MaxActivationDistance = origDist end
        local origLOS = prompt:GetAttribute("OrigLOS")
        if origLOS ~= nil then prompt.RequiresLineOfSight = origLOS end
    end
end

local function RegisterPrompt(prompt)
    if prompt:IsA("ProximityPrompt") then
        ActivePromptCache[prompt] = true
        ApplyPromptSettings(prompt)
    end
end

local function UnregisterPrompt(prompt)
    ActivePromptCache[prompt] = nil
end

local function UpdateAllPrompts()
    for prompt in pairs(ActivePromptCache) do
        if prompt and prompt.Parent then
            ApplyPromptSettings(prompt)
        else
            ActivePromptCache[prompt] = nil
        end
    end
end

TrackConnection(workspace.DescendantAdded:Connect(function(desc)
    if desc:IsA("ProximityPrompt") then
        RegisterPrompt(desc)
    end
end))

TrackConnection(workspace.DescendantRemoving:Connect(function(desc)
    if desc:IsA("ProximityPrompt") then
        UnregisterPrompt(desc)
    end
end))

task.spawn(function()
    for _, desc in ipairs(workspace:GetDescendants()) do
        if desc:IsA("ProximityPrompt") then
            RegisterPrompt(desc)
        end
    end
end)

TrackConnection(ProximityPromptService.PromptButtonHoldBegan:Connect(function(prompt)
    if State.InstantInteract then
        prompt.HoldDuration = 0
        if fireproximityprompt then
            fireproximityprompt(prompt)
        end
    end
end))

local function IsItemOrGearPrompt(prompt)
    if not prompt or not prompt:IsA("ProximityPrompt") then return false end
    local parent = prompt.Parent
    if not parent then return false end

    local playersFolder = workspace:FindFirstChild("Players")
    if playersFolder and (parent:IsDescendantOf(playersFolder) or parent:FindFirstAncestor("Players")) then
        return false
    end

    local pn = parent.Name:lower()
    if pn:find("generator") or pn:find("lockbox") or pn:find("locker") or pn:find("door") or pn:find("gate") or pn:find("exit") or pn:find("puzzle") then
        return false
    end

    local at = (prompt.ActionText or ""):lower()
    local ot = (prompt.ObjectText or ""):lower()

    if at:find("pick") or at:find("take") or at:find("grab") or at:find("collect") or at:find("loot") or at:find("equip") or at:find("search") or at:find("open") then
        return true
    end
    if ot:find("gear") or ot:find("cog") or ot:find("item") or ot:find("medkit") or ot:find("battery") or ot:find("flashlight") or ot:find("chest") or ot:find("crate") or ot:find("tool") or ot:find("key") or ot:find("soda") or ot:find("drink") or ot:find("bandage") then
        return true
    end
    if pn:find("gear") or pn:find("cog") or pn:find("item") or pn:find("medkit") or pn:find("battery") or pn:find("flashlight") or pn:find("chest") or pn:find("crate") or pn:find("tool") or pn:find("key") or pn:find("pickup") or pn:find("drop") then
        return true
    end

    local pParentName = parent.Parent and parent.Parent.Name:lower() or ""
    if pParentName:find("item") or pParentName:find("spawner") or pParentName:find("gear") or pParentName:find("loot") or pParentName:find("pickup") then
        return true
    end

    if GearCache[parent] or ItemCache[parent] or (parent.Parent and (GearCache[parent.Parent] or ItemCache[parent.Parent])) then
        return true
    end

    return false
end

task.spawn(function()
    while Running do
        task.wait(0.2)
        if State.AutoProximityInteract and fireproximityprompt then
            local myChar = LocalPlayer.Character
            local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")
            if myHRP then
                local myPos = myHRP.Position
                for prompt in pairs(ActivePromptCache) do
                    if prompt and prompt.Parent and prompt.Enabled then
                        if IsItemOrGearPrompt(prompt) then
                            local parentPart = prompt.Parent:IsA("BasePart") and prompt.Parent or prompt.Parent:FindFirstChildWhichIsA("BasePart")
                            if parentPart then
                                local dist = (parentPart.Position - myPos).Magnitude
                                if dist <= (prompt.MaxActivationDistance + 4) then
                                    fireproximityprompt(prompt)
                                    task.wait(0.08)
                                end
                            end
                        end
                    else
                        ActivePromptCache[prompt] = nil
                    end
                end
            end
        end
    end
end)

-- =========================================================================
-- ALERT BANNER & ESP FACTORY
-- =========================================================================
local AlertGui = Instance.new("ScreenGui")
AlertGui.Name = "ForsakenAlertGui"
AlertGui.ResetOnSpawn = false
pcall(function() AlertGui.Parent = CoreGui end)
if not AlertGui.Parent then AlertGui.Parent = LocalPlayer:WaitForChild("PlayerGui") end

local AlertLabel = Instance.new("TextLabel")
AlertLabel.Name = "AlertLabel"
AlertLabel.Size = UDim2.new(0, 360, 0, 42)
AlertLabel.Position = UDim2.new(0.5, -180, 0.12, 0)
AlertLabel.BackgroundColor3 = Color3.fromRGB(220, 20, 40)
AlertLabel.BackgroundTransparency = 0.2
AlertLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
AlertLabel.Font = Enum.Font.GothamBold
AlertLabel.TextSize = 16
AlertLabel.Text = "[!] KILLER NEARBY [!]"
AlertLabel.Visible = false
AlertLabel.BorderSizePixel = 0
AlertLabel.Parent = AlertGui

local AlertCorner = Instance.new("UICorner")
AlertCorner.CornerRadius = UDim.new(0, 8)
AlertCorner.Parent = AlertLabel

local AlertStroke = Instance.new("UIStroke")
AlertStroke.Color = Color3.fromRGB(255, 255, 255)
AlertStroke.Thickness = 1.5
AlertStroke.Transparency = 0.3
AlertStroke.Parent = AlertLabel

local ESPFolder = Instance.new("Folder")
ESPFolder.Name = "ForsakenESP"
pcall(function() ESPFolder.Parent = CoreGui end)
if not ESPFolder.Parent then ESPFolder.Parent = workspace end

local function CreateHighlight(adornee, color)
    local hl = Instance.new("Highlight")
    hl.Name = "ForsakenHighlight_" .. adornee.Name
    hl.Adornee = adornee
    hl.FillColor = color
    hl.FillTransparency = 0.55
    hl.OutlineColor = Color3.fromRGB(255, 255, 255)
    hl.OutlineTransparency = 0.1
    hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
    hl.Parent = ESPFolder
    return hl
end

local function CreateBillboard(adornee, text, color)
    local bb = Instance.new("BillboardGui")
    bb.Name = "ForsakenBillboard_" .. adornee.Name
    bb.Adornee = adornee
    bb.Size = UDim2.new(0, 160, 0, 40)
    bb.StudsOffset = Vector3.new(0, 3.2, 0)
    bb.AlwaysOnTop = true
    bb.ResetOnSpawn = false
    bb.MaxDistance = 400

    local label = Instance.new("TextLabel")
    label.Name = "Label"
    label.Size = UDim2.new(1, 0, 1, 0)
    label.BackgroundTransparency = 1
    label.Font = Enum.Font.GothamBold
    label.TextSize = 13
    label.TextColor3 = color
    label.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
    label.TextStrokeTransparency = 0.2
    label.Text = text
    label.Parent = bb

    bb.Parent = ESPFolder
    return bb, label
end

local function ClearESP()
    for _, item in pairs(Highlights) do
        if item and item.Parent then item:Destroy() end
    end
    table.clear(Highlights)

    for _, item in pairs(Billboards) do
        if item and item.Gui and item.Gui.Parent then item.Gui:Destroy() end
    end
    table.clear(Billboards)
end

-- =========================================================================
-- UNIVERSAL AUTO-SOLVER HOOKS FOR ALL 4 GENERATOR PUZZLES
-- =========================================================================
getgenv()._ForsakenCleanOriginals = getgenv()._ForsakenCleanOriginals or {}

local function GetClassValues(mod)
    if not mod then return nil end
    for k, v in pairs(mod) do
        if tostring(k):find("ClassValues") then
            return v
        end
    end
    return nil
end

local function SolveFlowGrid(size, pairsList)
    local numPairs = #pairsList
    local totalCells = size * size

    local function getNeighbors(cell)
        local r = math.floor((cell - 1) / size) + 1
        local c = ((cell - 1) % size) + 1
        local n = {}
        if r > 1 then table.insert(n, cell - size) end
        if r < size then table.insert(n, cell + size) end
        if c > 1 then table.insert(n, cell - 1) end
        if c < size then table.insert(n, cell + 1) end
        return n
    end

    local endpoints = {}
    for pIdx, p in ipairs(pairsList) do
        endpoints[p[1]] = pIdx
        endpoints[p[2]] = pIdx
    end

    local FlowBoardMod = FlowBoard or require(ReplicatedStorage.Modules.Minigames.FlowBoard)

    local adj = {}
    for i = 1, totalCells do adj[i] = getNeighbors(i) end

    local pairOrder = {}
    for i = 1, numPairs do table.insert(pairOrder, i) end
    table.sort(pairOrder, function(a, b)
        local pa, pb = pairsList[a], pairsList[b]
        local ra1, ca1 = math.floor((pa[1] - 1) / size) + 1, ((pa[1] - 1) % size) + 1
        local ra2, ca2 = math.floor((pa[2] - 1) / size) + 1, ((pa[2] - 1) % size) + 1
        local rb1, cb1 = math.floor((pb[1] - 1) / size) + 1, ((pb[1] - 1) % size) + 1
        local rb2, cb2 = math.floor((pb[2] - 1) / size) + 1, ((pb[2] - 1) % size) + 1
        local da = math.abs(ra1 - ra2) + math.abs(ca1 - ca2)
        local db = math.abs(rb1 - rb2) + math.abs(cb1 - cb2)
        return da < db
    end)

    local visited = {}
    local dfsPaths = {}

    local function canReach(startOrderIdx)
        for k = startOrderIdx, numPairs do
            local pidx = pairOrder[k]
            local s, t = pairsList[pidx][1], pairsList[pidx][2]
            local q = { s }
            local seen = { [s] = true }
            local found = false
            local qHead = 1
            while qHead <= #q do
                local curr = q[qHead]
                qHead = qHead + 1
                if curr == t then found = true break end
                for _, nxt in ipairs(adj[curr]) do
                    if not seen[nxt] and (not visited[nxt] or nxt == t) then
                        seen[nxt] = true
                        table.insert(q, nxt)
                    end
                end
            end
            if not found then return false end
        end
        return true
    end

    local maxDfsSteps = 45000
    local dfsStepCount = 0

    local function dfsPath(orderIdx, curr, target, currentPath)
        dfsStepCount = dfsStepCount + 1
        if dfsStepCount > maxDfsSteps then return false end

        if curr == target then
            local copied = {}
            for i, v in ipairs(currentPath) do copied[i] = v end
            dfsPaths[pairOrder[orderIdx]] = copied
            if orderIdx == numPairs then return true end
            if not canReach(orderIdx + 1) then return false end
            local nextP = pairOrder[orderIdx + 1]
            local ns, nt = pairsList[nextP][1], pairsList[nextP][2]
            visited[ns] = true
            local ok = dfsPath(orderIdx + 1, ns, nt, { ns })
            visited[ns] = false
            return ok
        end

        local tr = math.floor((target - 1) / size) + 1
        local tc = ((target - 1) % size) + 1

        local nbrs = {}
        for _, nxt in ipairs(adj[curr]) do
            if nxt == target then
                table.insert(nbrs, { dist = 0, cell = nxt })
            elseif not visited[nxt] and not endpoints[nxt] then
                local nr = math.floor((nxt - 1) / size) + 1
                local nc = ((nxt - 1) % size) + 1
                local d = math.abs(nr - tr) + math.abs(nc - tc)
                table.insert(nbrs, { dist = d, cell = nxt })
            end
        end
        table.sort(nbrs, function(a, b) return a.dist < b.dist end)

        for _, nInfo in ipairs(nbrs) do
            local nxt = nInfo.cell
            visited[nxt] = true
            table.insert(currentPath, nxt)
            if dfsPath(orderIdx, nxt, target, currentPath) then return true end
            table.remove(currentPath)
            visited[nxt] = false
        end
        return false
    end

    local firstP = pairOrder[1]
    local s1, t1 = pairsList[firstP][1], pairsList[firstP][2]
    visited[s1] = true
    local dfsSuccess = dfsPath(1, s1, t1, { s1 })
    visited[s1] = false

    if dfsSuccess and FlowBoardMod and FlowBoardMod.Validate then
        local valid = FlowBoardMod.Validate(size, pairsList, dfsPaths)
        if valid then return dfsPaths end
    elseif dfsSuccess then
        return dfsPaths
    end

    local cellOcc = {}
    local cellCost = {}
    for i = 1, totalCells do
        cellOcc[i] = 0
        cellCost[i] = 1
    end
    local paths = {}

    local function routePair(pIdx, presMult)
        local start = pairsList[pIdx][1]
        local target = pairsList[pIdx][2]
        local tr = math.floor((target - 1) / size) + 1
        local tc = ((target - 1) % size) + 1

        local openSet = { start }
        local cameFrom = {}
        local gScore = { [start] = 0 }
        local fScore = { [start] = math.abs(math.floor((start-1)/size)+1 - tr) + math.abs(((start-1)%size)+1 - tc) }
        local inOpen = { [start] = true }

        while #openSet > 0 do
            local bestIdx = 1
            for i = 2, #openSet do
                if fScore[openSet[i]] < fScore[openSet[bestIdx]] then bestIdx = i end
            end
            local current = table.remove(openSet, bestIdx)
            inOpen[current] = nil

            if current == target then
                local path = {}
                local curr = target
                while curr do
                    table.insert(path, 1, curr)
                    curr = cameFrom[curr]
                end
                return path
            end

            for _, nxt in ipairs(getNeighbors(current)) do
                local ep = endpoints[nxt]
                if ep == nil or nxt == target then
                    local cong = cellOcc[nxt]
                    local stepCost = cellCost[nxt] + (cong * presMult)
                    local tentG = gScore[current] + stepCost

                    if not gScore[nxt] or tentG < gScore[nxt] then
                        cameFrom[nxt] = current
                        gScore[nxt] = tentG
                        local nr = math.floor((nxt - 1) / size) + 1
                        local nc = ((nxt - 1) % size) + 1
                        local h = math.abs(nr - tr) + math.abs(nc - tc)
                        fScore[nxt] = tentG + h
                        if not inOpen[nxt] then
                            table.insert(openSet, nxt)
                            inOpen[nxt] = true
                        end
                    end
                end
            end
        end
        return nil
    end

    for pIdx = 1, numPairs do
        local p = routePair(pIdx, 0)
        paths[pIdx] = p
        if p then
            for i = 2, #p - 1 do cellOcc[p[i]] = cellOcc[p[i]] + 1 end
        end
    end

    local presMult = 2.0
    for _ = 1, 60 do
        local conflicts = 0
        for i = 1, totalCells do
            if cellOcc[i] > 1 then
                conflicts = conflicts + (cellOcc[i] - 1)
                cellCost[i] = cellCost[i] + (cellOcc[i] * 1.5)
            end
        end
        if conflicts == 0 then
            if FlowBoardMod and FlowBoardMod.Validate then
                local valid = FlowBoardMod.Validate(size, pairsList, paths)
                if valid then return paths end
            else
                return paths
            end
        end
        presMult = presMult + 2.5
        for pIdx = 1, numPairs do
            local p = paths[pIdx]
            local hasConflict = false
            if p then
                for i = 2, #p - 1 do
                    if cellOcc[p[i]] > 1 then hasConflict = true break end
                end
            else
                hasConflict = true
            end
            if hasConflict then
                if p then
                    for i = 2, #p - 1 do cellOcc[p[i]] = math.max(0, cellOcc[p[i]] - 1) end
                end
                local np = routePair(pIdx, presMult)
                paths[pIdx] = np
                if np then
                    for i = 2, #np - 1 do cellOcc[np[i]] = cellOcc[np[i]] + 1 end
                end
            end
        end
    end

    return nil
end

local flowCV = GetClassValues(FlowClientMinigame)
if flowCV and flowCV.Start then
    if not getgenv()._ForsakenCleanOriginals.FlowStart then
        getgenv()._ForsakenCleanOriginals.FlowStart = flowCV.Start
    end
    local cleanFlowStart = getgenv()._ForsakenCleanOriginals.FlowStart

    flowCV.Start = function(self, ...)
        cleanFlowStart(self, ...)
        if State.AutoAllPuzzles and self.Network then
            task.spawn(function()
                local tStart = os.clock()
                task.wait(0.15)

                pcall(function()
                    local props = self.Network.Properties
                    local size = props:Get("GridSize")
                    local pairsList = props:Get("Pairs")
                    if size and pairsList then
                        local sol = SolveFlowGrid(size, pairsList)
                        if sol and #sol == #pairsList then
                            local renderer = self.__renderer
                            local board = renderer and renderer.Board

                            local totalSteps = 0
                            for _, path in ipairs(sol) do
                                totalSteps = totalSteps + math.max(1, #path - 1)
                            end
                            local stepDelay = math.clamp(1.70 / math.max(1, totalSteps), 0.015, 0.06)

                            for pIdx, path in ipairs(sol) do
                                if not self or not self.Network then break end
                                if board then
                                    board.Paths[pIdx] = { path[1] }
                                end

                                for step = 2, #path do
                                    if not self or not self.Network then break end
                                    if board then
                                        table.insert(board.Paths[pIdx], path[step])
                                        pcall(function() renderer:Render() end)
                                    end
                                    task.wait(stepDelay)
                                end

                                if board and renderer then
                                    pcall(function() renderer:Render() end)
                                end
                            end

                            if board then
                                pcall(function()
                                    board:__rebuild()
                                    if renderer then renderer:Render() end
                                end)
                            end

                            local elapsed = os.clock() - tStart
                            if elapsed < 1.95 then
                                task.wait(2.0 - elapsed)
                            end

                            if self and self.Network then
                                if self.__input then
                                    pcall(function() self.__input:__finish() end)
                                end
                                self.Network:FireServer("Submit", sol)
                                pcall(function()
                                    local Sounds = require(ReplicatedStorage.Modules.Rendering.Sounds)
                                    Sounds:Play("puzzleDone")
                                end)
                                Notify("Flow Solved", string.format("Сетка %dx%d решена (%d проводов)", size, size, #pairsList), 2.0)
                            end
                        end
                    end
                end)
            end)
        end
    end
end

local connectCV = GetClassValues(ConnectClientMinigame)
if connectCV and connectCV.Start then
    if not getgenv()._ForsakenCleanOriginals.ConnectStart then
        getgenv()._ForsakenCleanOriginals.ConnectStart = connectCV.Start
    end
    local cleanConnectStart = getgenv()._ForsakenCleanOriginals.ConnectStart

    connectCV.Start = function(self, ...)
        cleanConnectStart(self, ...)
        if State.AutoAllPuzzles and self.Network then
            task.spawn(function()
                task.wait(math.random(400, 600) / 1000)
                pcall(function()
                    local props = self.Network.Properties
                    local blobs = props:Get("Blobs")
                    if blobs and ConnectBoard then
                        local b = ConnectBoard.new(blobs)
                        local renderer = self.__renderer

                        for i = 1, #b.Blobs do
                            if not self or not self.Network then break end
                            local mate = b.Mates[i]
                            if mate and not b.Links[i] then
                                b:Connect(i, mate)
                                if renderer then
                                    pcall(function() renderer:Render() end)
                                end
                                task.wait(math.random(420, 650) / 1000)
                            end
                        end

                        task.wait(math.random(220, 350) / 1000)
                        if self and self.Network then
                            self.Network:FireServer("Submit", b:Export())
                            pcall(function() self:Finish() end)
                            Notify("Connect Solved", "Головоломка Connect решена!", 2.5)
                        end
                    end
                end)
            end)
        end
    end
end

local lockCV = GetClassValues(LockClientMinigame)
if lockCV and lockCV.Start then
    if not getgenv()._ForsakenCleanOriginals.LockStart then
        getgenv()._ForsakenCleanOriginals.LockStart = lockCV.Start
    end
    local cleanLockStart = getgenv()._ForsakenCleanOriginals.LockStart

    lockCV.Start = function(self, ...)
        cleanLockStart(self, ...)
        if State.AutoAllPuzzles and self.Network then
            task.spawn(function()
                task.wait(0.12)

                local board = nil
                local onPress = nil

                for _ = 1, 15 do
                    if self.__renderer and self.__renderer.Board then
                        board = self.__renderer.Board
                    end
                    if self.__input and self.__input.Callbacks and self.__input.Callbacks.OnPress then
                        onPress = self.__input.Callbacks.OnPress
                    end
                    if board then break end
                    task.wait(0.04)
                end

                if not board and self.__input and self.__input.Board then
                    board = self.__input.Board
                end

                local startTime = os.clock()
                local lastPressTime = 0

                while self and self.Network and (os.clock() - startTime < 45) do
                    RunService.Heartbeat:Wait()
                    if not self or not self.Network then break end

                    if board and board.State and board.State.Remaining and board.State.Remaining <= 0 then
                        break
                    end
                    if board and board.IsBroken and board:IsBroken() then
                        break
                    end

                    local stNow = workspace:GetServerTimeNow()
                    local shouldPress = false

                    if board and board.AngleAt and board.State and board.State.Target then
                        local currentAngle = board:AngleAt(stNow)
                        local targetAngle = board.State.Target
                        local targetSize = (board.Config and board.Config.TargetSize) or 35
                        local diff = math.abs((currentAngle - targetAngle + 180) % 360 - 180)
                        if diff <= (targetSize * 0.30) then
                            shouldPress = true
                        end
                    elseif board and board.AngleAt and board.IsOnTarget then
                        local currentAngle = board:AngleAt(stNow)
                        if board:IsOnTarget(currentAngle) then
                            shouldPress = true
                        end
                    elseif self.__renderer and self.__renderer.Line and self.__renderer.__target then
                        local lineRot = self.__renderer.Line.Rotation % 360
                        local targetRot = self.__renderer.__target.Rotation % 360
                        local diff = math.abs((lineRot - targetRot + 180) % 360 - 180)
                        if diff <= 12 then
                            shouldPress = true
                        end
                    end

                    if shouldPress and (os.clock() - lastPressTime > 0.38) then
                        lastPressTime = os.clock()
                        local pressTime = workspace:GetServerTimeNow()
                        if onPress then
                            pcall(onPress)
                        elseif self.Network then
                            self.Network:FireServer("Press", pressTime)
                        end
                        task.wait(0.32)
                    end
                end

                Notify("Lock Solved", "Замок успешно открыт!", 2.5)
            end)
        end
    end
end

local gearCV = GetClassValues(GearClientMinigame)
if gearCV and gearCV.Start then
    if not getgenv()._ForsakenCleanOriginals.GearStart then
        getgenv()._ForsakenCleanOriginals.GearStart = gearCV.Start
    end
    local cleanGearStart = getgenv()._ForsakenCleanOriginals.GearStart

    gearCV.Start = function(self, ...)
        cleanGearStart(self, ...)
        if State.AutoAllPuzzles and self.Network then
            task.spawn(function()
                task.wait(math.random(400, 600) / 1000)
                pcall(function()
                    local turns = self.Network.Properties:Get("Turns") or 5
                    for _ = 1, turns do
                        if not self or not self.Network then break end
                        task.wait(math.random(750, 920) / 1000)
                        self.Network:FireServer("Screwed")
                    end
                    task.wait(0.25)
                    Notify("Gear Solved", "Шестерёнки закручены!", 2.5)
                end)
            end)
        end
    end
end

-- =========================================================================
-- TRIGGERBOT & KILLER AIM ENGINE
-- =========================================================================
local CachedIsKiller = nil
local LastRoleCheckTime = 0

local function IsLocalPlayerKiller()
    local now = os.clock()
    if CachedIsKiller ~= nil and (now - LastRoleCheckTime) < 2.0 then
        return CachedIsKiller
    end
    LastRoleCheckTime = now

    local myChar = LocalPlayer.Character
    if not myChar then
        CachedIsKiller = false
        return false
    end
    local playersRoot = workspace:FindFirstChild("Players")
    if playersRoot then
        local killersFolder = playersRoot:FindFirstChild("Killers")
        if killersFolder and killersFolder:FindFirstChild(myChar.Name) then
            CachedIsKiller = true
            return true
        end
    end
    local role = myChar:GetAttribute("Role") or (LocalPlayer.Team and LocalPlayer.Team.Name) or ""
    if tostring(role):lower():find("killer") then
        CachedIsKiller = true
        return true
    end
    CachedIsKiller = false
    return false
end

local LastTriggerbotTime = 0
local function RunTriggerbot()
    if not State.Triggerbot or not IsLocalPlayerKiller() then return end

    local myChar = LocalPlayer.Character
    local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")
    if not myHRP then return end

    local playersRoot = workspace:FindFirstChild("Players")
    local survivorsFolder = playersRoot and playersRoot:FindFirstChild("Survivors")
    if not survivorsFolder then return end

    local myPos = myHRP.Position
    local closestDist = 999999
    local closestHRP = nil

    for _, surv in ipairs(survivorsFolder:GetChildren()) do
        if surv:IsA("Model") and surv ~= myChar then
            local sHRP = surv:FindFirstChild("HumanoidRootPart")
            local hum = surv:FindFirstChildOfClass("Humanoid")
            if sHRP and (not hum or hum.Health > 0) then
                local dist = (sHRP.Position - myPos).Magnitude
                if dist < closestDist then
                    closestDist = dist
                    closestHRP = sHRP
                end
            end
        end
    end

    if closestHRP then
        local flatTarget = Vector3.new(closestHRP.Position.X, myHRP.Position.Y, closestHRP.Position.Z)
        myHRP.CFrame = CFrame.lookAt(myHRP.Position, flatTarget)

        local now = os.clock()
        if closestDist <= State.TriggerbotRange and (now - LastTriggerbotTime) >= State.TriggerbotCooldown then
            LastTriggerbotTime = now
            if mouse1click then
                mouse1click()
            else
                VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 1)
                task.delay(0.04, function()
                    VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 1)
                end)
            end
            local tool = myChar:FindFirstChildWhichIsA("Tool")
            if tool then
                pcall(function() tool:Activate() end)
            end
        end
    end
end

-- =========================================================================
-- RUNTIME LOOPS (MOVEMENT, COMBAT, LIGHTING, FOV)
-- =========================================================================
local IsShiftEmulated = false
local LastMoveTime = 0
local LastBlockTime = 0
local LastAntiSlowCheck = 0
local LastVFXCheck = 0

TrackConnection(RunService.Stepped:Connect(function()
    if not Running then return end
    local myChar = LocalPlayer.Character
    if not myChar then return end

    local hum = myChar:FindFirstChildOfClass("Humanoid")
    if hum and State.ForcedJump then
        hum.UseJumpPower = true
        hum.JumpPower = State.JumpPower
        hum.JumpHeight = State.JumpPower / 7
        hum:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
    end

    local now = os.clock()
    if State.AntiSlow and (now - LastAntiSlowCheck) > 0.12 then
        LastAntiSlowCheck = now
        local sm = myChar:FindFirstChild("SpeedMultipliers")
        if sm then
            for _, val in ipairs(sm:GetChildren()) do
                if val:IsA("NumberValue") and val.Value < 1 and val.Name ~= "DirectionalMovement" then
                    val.Value = 1
                end
            end
        end
        local scm = myChar:FindFirstChild("SpeedCapMultipliers")
        if scm then
            for _, val in ipairs(scm:GetChildren()) do
                if val:IsA("NumberValue") and val.Value < 1 then
                    val.Value = 1
                end
            end
        end
    end
end))

TrackConnection(RunService.Heartbeat:Connect(function()
    if not Running then return end
    local now = os.clock()
    local myChar = LocalPlayer.Character
    local hum = myChar and myChar:FindFirstChildOfClass("Humanoid")
    local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")

    if State.InfiniteStamina and SprintingModule then
        SprintingModule.StaminaLossDisabled = true
        SprintingModule.Stamina = SprintingModule.MaxStamina or 110
    end

    if State.AutoSprint and hum then
        local isMoving = hum.MoveDirection.Magnitude > 0.05
        if isMoving then
            LastMoveTime = now
        end

        if (now - LastMoveTime) < 0.30 then
            if SprintingModule then
                SprintingModule.IsSprinting = true
                if SprintingModule.StartSprinting and not SprintingModule.IsSprinting then
                    pcall(function() SprintingModule:StartSprinting() end)
                end
            end

            local targetSpeed = (SprintingModule and SprintingModule.SprintSpeed) or 26
            if hum.WalkSpeed < targetSpeed then
                hum.WalkSpeed = targetSpeed
            end

            local sm = myChar:FindFirstChild("SpeedMultipliers")
            if sm then
                local spVal = sm:FindFirstChild("Sprint")
                if spVal and spVal:IsA("NumberValue") and spVal.Value < 1.6 then
                    spVal.Value = 1.65
                end
            end

            if not IsShiftEmulated then
                IsShiftEmulated = true
                VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.LeftShift, false, game)
            end
        elseif IsShiftEmulated then
            IsShiftEmulated = false
            VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.LeftShift, false, game)
            if SprintingModule and SprintingModule.StopSprinting then
                pcall(function() SprintingModule:StopSprinting() end)
            end
        end
    elseif IsShiftEmulated then
        IsShiftEmulated = false
        VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.LeftShift, false, game)
    end

    if State.Fullbright then
        Lighting.Ambient = Color3.fromRGB(255, 255, 255)
        Lighting.OutdoorAmbient = Color3.fromRGB(255, 255, 255)
        Lighting.Brightness = 2
        Lighting.ClockTime = 14
        Lighting.FogEnd = 100000
        Lighting.GlobalShadows = false
    end

    if Camera and State.CustomFOV ~= 70 and math.abs(Camera.FieldOfView - State.CustomFOV) > 0.5 then
        Camera.FieldOfView = State.CustomFOV
    end

    if State.RemoveVFX and (now - LastVFXCheck) > 0.5 then
        LastVFXCheck = now
        local pg = LocalPlayer:FindFirstChild("PlayerGui")
        local mainUI = pg and pg:FindFirstChild("MainUI")
        local vig = mainUI and mainUI:FindFirstChild("InsaneVignette")
        if vig and vig.Visible then vig.Visible = false end
    end

    if myHRP and (State.AutoBlock or State.AutoAvoidKiller) then
        local killersFolder = workspace:FindFirstChild("Players") and workspace.Players:FindFirstChild("Killers")
        if killersFolder then
            for _, killer in ipairs(killersFolder:GetChildren()) do
                local kHRP = killer:FindFirstChild("HumanoidRootPart")
                if kHRP then
                    local dist = (kHRP.Position - myHRP.Position).Magnitude

                    if State.AutoBlock and dist <= State.AutoBlockRange and (now - LastBlockTime) > 2.5 then
                        LastBlockTime = now
                        local flatTarget = Vector3.new(kHRP.Position.X, myHRP.Position.Y, kHRP.Position.Z)
                        myHRP.CFrame = CFrame.lookAt(myHRP.Position, flatTarget)
                        VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.Q, false, game)
                        task.delay(0.06, function()
                            VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.Q, false, game)
                        end)
                    end

                    if State.AutoAvoidKiller and dist <= State.AutoAvoidKillerRange then
                        local avoidDir, upBoost = GetSmartAvoidVector(myHRP, kHRP)
                        local curY = myHRP.AssemblyLinearVelocity.Y
                        myHRP.AssemblyLinearVelocity = Vector3.new(
                            avoidDir.X * State.AvoidRepelForce,
                            math.max(curY, upBoost),
                            avoidDir.Z * State.AvoidRepelForce
                        )
                    end
                end
            end
        end
    end

    if State.Triggerbot then
        RunTriggerbot()
    end
end))

TrackConnection(UserInputService.JumpRequest:Connect(function()
    if not Running then return end
    local myChar = LocalPlayer.Character
    local hum = myChar and myChar:FindFirstChildOfClass("Humanoid")
    local hrp = myChar and myChar:FindFirstChild("HumanoidRootPart")

    if State.ForcedJump or State.InfiniteJump then
        if hum then
            hum:ChangeState(Enum.HumanoidStateType.Jumping)
        end
        if hrp and State.InfiniteJump then
            hrp.AssemblyLinearVelocity = Vector3.new(hrp.AssemblyLinearVelocity.X, State.JumpPower, hrp.AssemblyLinearVelocity.Z)
        end
    end
end))

-- =========================================================================
-- PROXIMITY-PRIORITIZED HIGHLIGHTS & ESP LOOP
-- =========================================================================
local MAX_ACTIVE_HIGHLIGHTS = 28
local MAX_ESP_DISTANCE = 400

local function UpdateHighlightsPriority(candidates)
    if not State.ChamsEnabled then
        for _, hl in pairs(Highlights) do
            if hl and hl.Parent then hl:Destroy() end
        end
        table.clear(Highlights)
        return
    end

    table.sort(candidates, function(a, b) return a.Score < b.Score end)

    local activeSet = {}
    local count = 0

    for _, c in ipairs(candidates) do
        if c.Dist and c.Dist > MAX_ESP_DISTANCE then
            continue
        end
        count = count + 1
        if count <= MAX_ACTIVE_HIGHLIGHTS then
            activeSet[c.Object] = true
            local hl = Highlights[c.Object]
            if not hl then
                Highlights[c.Object] = CreateHighlight(c.Object, c.Color)
            elseif hl.FillColor ~= c.Color then
                hl.FillColor = c.Color
            end
        else
            break
        end
    end

    for obj, hl in pairs(Highlights) do
        if not activeSet[obj] then
            if hl and hl.Parent then hl:Destroy() end
            Highlights[obj] = nil
        end
    end
end

task.spawn(function()
    while Running do
        task.wait(0.25)
        if not Running then break end
        if not State.ESPEnabled then
            ClearESP()
            AlertLabel.Visible = false
        else
            local myChar = LocalPlayer.Character
            local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")
            local myPos = myHRP and myHRP.Position or Camera.CFrame.Position

            local closestKillerDist = 999999
            local closestKillerName = ""
            local highlightCandidates = {}

            local playersRoot = workspace:FindFirstChild("Players")
            if playersRoot then
                if State.SurvivorsESP then
                    local sFolder = playersRoot:FindFirstChild("Survivors")
                    if sFolder then
                        for _, char in ipairs(sFolder:GetChildren()) do
                            if char ~= myChar and char:IsA("Model") then
                                local hrp = char:FindFirstChild("HumanoidRootPart")
                                local hum = char:FindFirstChildOfClass("Humanoid")
                                if hrp then
                                    local dist = math.floor((hrp.Position - myPos).Magnitude)
                                    if dist <= MAX_ESP_DISTANCE then
                                        local hp = hum and math.floor(hum.Health) or 0
                                        local rec = Billboards[char]

                                        if not rec then
                                            local role = char:GetAttribute("ActorDisplayName") or char.Name
                                            local user = char:GetAttribute("Username") or ""
                                            local maxHp = hum and math.floor(hum.MaxHealth) or 100
                                            local text = string.format("[SURVIVOR] %s (%s)\nHP: %d/%d | %dm", role, user ~= "" and user or char.Name, hp, maxHp, dist)
                                            local bb, lbl = CreateBillboard(hrp, text, Color3.fromRGB(0, 255, 140))
                                            Billboards[char] = { Gui = bb, Label = lbl, LastDist = dist, LastHp = hp, Role = role, User = user, MaxHp = maxHp }
                                        elseif math.abs((rec.LastDist or 0) - dist) >= 2 or rec.LastHp ~= hp then
                                            rec.LastDist = dist
                                            rec.LastHp = hp
                                            rec.Label.Text = string.format("[SURVIVOR] %s (%s)\nHP: %d/%d | %dm", rec.Role, rec.User ~= "" and rec.User or char.Name, hp, rec.MaxHp, dist)
                                        end

                                        if State.ChamsEnabled then
                                            table.insert(highlightCandidates, { Object = char, Color = Color3.fromRGB(0, 255, 140), Score = dist - 1000, Dist = dist })
                                        end
                                    elseif Billboards[char] then
                                        if Billboards[char].Gui and Billboards[char].Gui.Parent then Billboards[char].Gui:Destroy() end
                                        Billboards[char] = nil
                                    end
                                end
                            end
                        end
                    end
                end

                if State.KillersESP then
                    local kFolder = playersRoot:FindFirstChild("Killers")
                    if kFolder then
                        for _, char in ipairs(kFolder:GetChildren()) do
                            if char ~= myChar and char:IsA("Model") then
                                local hrp = char:FindFirstChild("HumanoidRootPart")
                                local hum = char:FindFirstChildOfClass("Humanoid")
                                if hrp then
                                    local dist = math.floor((hrp.Position - myPos).Magnitude)
                                    local role = char:GetAttribute("ActorDisplayName") or char.Name
                                    local user = char:GetAttribute("Username") or ""

                                    if dist < closestKillerDist then
                                        closestKillerDist = dist
                                        closestKillerName = role ~= "" and role or user
                                    end

                                    if dist <= MAX_ESP_DISTANCE then
                                        local hp = hum and math.floor(hum.Health) or 0
                                        local rec = Billboards[char]
                                        if not rec then
                                            local text = string.format("[KILLER] %s (%s)\nHP: %d | %dm", role, user ~= "" and user or char.Name, hp, dist)
                                            local bb, lbl = CreateBillboard(hrp, text, Color3.fromRGB(255, 45, 45))
                                            Billboards[char] = { Gui = bb, Label = lbl, LastDist = dist, LastHp = hp, Role = role, User = user }
                                        elseif math.abs((rec.LastDist or 0) - dist) >= 2 or rec.LastHp ~= hp then
                                            rec.LastDist = dist
                                            rec.LastHp = hp
                                            rec.Label.Text = string.format("[KILLER] %s (%s)\nHP: %d | %dm", rec.Role, rec.User ~= "" and rec.User or char.Name, hp, dist)
                                        end

                                        if State.ChamsEnabled then
                                            table.insert(highlightCandidates, { Object = char, Color = Color3.fromRGB(255, 45, 45), Score = dist - 2500, Dist = dist })
                                        end
                                    elseif Billboards[char] then
                                        if Billboards[char].Gui and Billboards[char].Gui.Parent then Billboards[char].Gui:Destroy() end
                                        Billboards[char] = nil
                                    end
                                end
                            end
                        end
                    end
                end
            end

            if State.KillerAlert and closestKillerDist <= State.KillerAlertDistance then
                AlertLabel.Text = string.format("[!] KILLER ALERT: %s (%dm) [!]", closestKillerName, closestKillerDist)
                AlertLabel.Visible = true
            else
                AlertLabel.Visible = false
            end

            if State.GeneratorsESP then
                local seenGens = {}
                for gen, mainPart in pairs(GeneratorCache) do
                    if gen and gen.Parent and mainPart and mainPart.Parent and mainPart:IsDescendantOf(workspace) then
                        local posKey = string.format("%d_%d_%d", math.floor(mainPart.Position.X / 6), math.floor(mainPart.Position.Y / 6), math.floor(mainPart.Position.Z / 6))
                        if seenGens[posKey] then
                            if Billboards[gen] then
                                if Billboards[gen].Gui and Billboards[gen].Gui.Parent then Billboards[gen].Gui:Destroy() end
                                Billboards[gen] = nil
                            end
                        else
                            seenGens[posKey] = true
                            local dist = math.floor((mainPart.Position - myPos).Magnitude)
                            if dist <= MAX_ESP_DISTANCE then
                                local prog = GetGeneratorProgress(gen)
                                local isDone = prog >= 100
                                local col = isDone and Color3.fromRGB(110, 255, 130) or Color3.fromRGB(255, 215, 0)
                                local rec = Billboards[gen]

                                if not rec then
                                    local text = string.format("[GEN] %d%% | %dm", prog, dist)
                                    local bb, lbl = CreateBillboard(mainPart, text, col)
                                    Billboards[gen] = { Gui = bb, Label = lbl, LastDist = dist, LastProg = prog }
                                elseif math.abs((rec.LastDist or 0) - dist) >= 2 or rec.LastProg ~= prog then
                                    rec.LastDist = dist
                                    rec.LastProg = prog
                                    rec.Label.Text = string.format("[GEN] %d%% | %dm", prog, dist)
                                    rec.Label.TextColor3 = col
                                end

                                if State.ChamsEnabled then
                                    table.insert(highlightCandidates, { Object = gen, Color = col, Score = dist, Dist = dist })
                                end
                            elseif Billboards[gen] then
                                if Billboards[gen].Gui and Billboards[gen].Gui.Parent then Billboards[gen].Gui:Destroy() end
                                Billboards[gen] = nil
                            end
                        end
                    else
                        UnregisterInstance(gen)
                    end
                end
            end

            if State.GearsESP then
                for gear, part in pairs(GearCache) do
                    if IsObjectPresent(gear, part) then
                        local dist = math.floor((part.Position - myPos).Magnitude)
                        if dist <= MAX_ESP_DISTANCE then
                            local col = Color3.fromRGB(0, 210, 255)
                            local rec = Billboards[gear]
                            if not rec then
                                local text = string.format("[GEAR] %dm", dist)
                                local bb, lbl = CreateBillboard(part, text, col)
                                Billboards[gear] = { Gui = bb, Label = lbl, LastDist = dist }
                            elseif math.abs((rec.LastDist or 0) - dist) >= 2 then
                                rec.LastDist = dist
                                rec.Label.Text = string.format("[GEAR] %dm", dist)
                            end

                            if State.ChamsEnabled then
                                table.insert(highlightCandidates, { Object = gear, Color = col, Score = dist - 200, Dist = dist })
                            end
                        elseif Billboards[gear] then
                            if Billboards[gear].Gui and Billboards[gear].Gui.Parent then Billboards[gear].Gui:Destroy() end
                            Billboards[gear] = nil
                        end
                    else
                        if Billboards[gear] then
                            if Billboards[gear].Gui and Billboards[gear].Gui.Parent then Billboards[gear].Gui:Destroy() end
                            Billboards[gear] = nil
                        end
                        if not gear or not gear.Parent then
                            GearCache[gear] = nil
                        end
                    end
                end
            end

            if State.TrapsESP then
                for trap, part in pairs(TrapCache) do
                    if trap and trap.Parent and part and part.Parent and part:IsDescendantOf(workspace) then
                        local dist = math.floor((part.Position - myPos).Magnitude)
                        if dist <= MAX_ESP_DISTANCE then
                            local col = Color3.fromRGB(255, 120, 0)
                            local trapName = trap.Name or "Trap"
                            local rec = Billboards[trap]
                            if not rec then
                                local text = string.format("[TRAP] %s\n%dm", trapName, dist)
                                local bb, lbl = CreateBillboard(part, text, col)
                                Billboards[trap] = { Gui = bb, Label = lbl, LastDist = dist }
                            elseif math.abs((rec.LastDist or 0) - dist) >= 2 then
                                rec.LastDist = dist
                                rec.Label.Text = string.format("[TRAP] %s\n%dm", trapName, dist)
                            end

                            if State.ChamsEnabled then
                                table.insert(highlightCandidates, { Object = trap, Color = col, Score = dist, Dist = dist })
                            end
                        elseif Billboards[trap] then
                            if Billboards[trap].Gui and Billboards[trap].Gui.Parent then Billboards[trap].Gui:Destroy() end
                            Billboards[trap] = nil
                        end
                    else
                        UnregisterInstance(trap)
                    end
                end
            end

            if State.ItemsESP then
                for item, data in pairs(ItemCache) do
                    local part = data.Part
                    if IsObjectPresent(item, part) then
                        local dist = math.floor((part.Position - myPos).Magnitude)
                        if dist <= MAX_ESP_DISTANCE then
                            local col = Color3.fromRGB(130, 255, 140)
                            local itemName = data.Name or "Item"
                            local rec = Billboards[item]
                            if not rec then
                                local text = string.format("[ITEM] %s\n%dm", itemName, dist)
                                local bb, lbl = CreateBillboard(part, text, col)
                                Billboards[item] = { Gui = bb, Label = lbl, LastDist = dist }
                            elseif math.abs((rec.LastDist or 0) - dist) >= 2 then
                                rec.LastDist = dist
                                rec.Label.Text = string.format("[ITEM] %s\n%dm", itemName, dist)
                            end

                            if State.ChamsEnabled then
                                table.insert(highlightCandidates, { Object = item, Color = col, Score = dist - 150, Dist = dist })
                            end
                        elseif Billboards[item] then
                            if Billboards[item].Gui and Billboards[item].Gui.Parent then Billboards[item].Gui:Destroy() end
                            Billboards[item] = nil
                        end
                    else
                        if Billboards[item] then
                            if Billboards[item].Gui and Billboards[item].Gui.Parent then Billboards[item].Gui:Destroy() end
                            Billboards[item] = nil
                        end
                        if not item or not item.Parent then
                            ItemCache[item] = nil
                        end
                    end
                end
            end

            UpdateHighlightsPriority(highlightCandidates)
        end
    end
end)

-- =========================================================================
-- GLOBAL CLEANUP
-- =========================================================================
getgenv().ForsakenCleanup = function()
    Running = false

    for _, conn in ipairs(Connections) do
        pcall(function() conn:Disconnect() end)
    end
    table.clear(Connections)

    ClearESP()
    table.clear(GeneratorCache)
    table.clear(GearCache)
    table.clear(TrapCache)
    table.clear(ItemCache)
    table.clear(ActivePromptCache)

    if ESPFolder and ESPFolder.Parent then ESPFolder:Destroy() end
    if AlertGui and AlertGui.Parent then AlertGui:Destroy() end

    if IsShiftEmulated then
        VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.LeftShift, false, game)
        IsShiftEmulated = false
    end

    for _, prompt in ipairs(workspace:GetDescendants()) do
        if prompt:IsA("ProximityPrompt") then
            local orig = prompt:GetAttribute("OrigHold")
            if orig ~= nil then prompt.HoldDuration = orig end
            local origDist = prompt:GetAttribute("OrigDist")
            if origDist ~= nil then prompt.MaxActivationDistance = origDist end
            local origLOS = prompt:GetAttribute("OrigLOS")
            if origLOS ~= nil then prompt.RequiresLineOfSight = origLOS end
        end
    end

    Lighting.Ambient = OriginalLighting.Ambient
    Lighting.OutdoorAmbient = OriginalLighting.OutdoorAmbient
    Lighting.Brightness = OriginalLighting.Brightness
    Lighting.ClockTime = OriginalLighting.ClockTime
    Lighting.FogEnd = OriginalLighting.FogEnd
    Lighting.GlobalShadows = OriginalLighting.GlobalShadows

    if SprintingModule then
        SprintingModule.StaminaLossDisabled = false
        SprintingModule.SprintSpeed = 28
    end

    if getgenv()._ForsakenCleanOriginals then
        if flowCV and getgenv()._ForsakenCleanOriginals.FlowStart then
            flowCV.Start = getgenv()._ForsakenCleanOriginals.FlowStart
        end
        if connectCV and getgenv()._ForsakenCleanOriginals.ConnectStart then
            connectCV.Start = getgenv()._ForsakenCleanOriginals.ConnectStart
        end
        if lockCV and getgenv()._ForsakenCleanOriginals.LockStart then
            lockCV.Start = getgenv()._ForsakenCleanOriginals.LockStart
        end
        if gearCV and getgenv()._ForsakenCleanOriginals.GearStart then
            gearCV.Start = getgenv()._ForsakenCleanOriginals.GearStart
        end
    end

    pcall(function() Rayfield:Destroy() end)
end

-- =========================================================================
-- RAYFIELD UI WINDOW & TABS
-- =========================================================================
local Window = Rayfield:CreateWindow({
    Name = "Forsaken",
    Icon = 0,
    LoadingTitle = "Forsaken",
    LoadingSubtitle = "Loading script...",
    Theme = "Default",
    DisableRayfieldPrompts = true,
    DisableBuildWarnings = true,
    ConfigurationSaving = {
        Enabled = false,
    },
    KeySystem = false,
    ToggleUIKeybind = "F1",
})

-- 1. MOVEMENT
local TabMovement = Window:CreateTab("Movement", "footprints")
TabMovement:CreateSection("Jump & Movement")

TabMovement:CreateToggle({
    Name = "Forced Jump (Разблокировать прыжок)",
    CurrentValue = State.ForcedJump,
    Flag = "ForcedJump",
    Callback = function(val)
        State.ForcedJump = val
        local myChar = LocalPlayer.Character
        local hum = myChar and myChar:FindFirstChildOfClass("Humanoid")
        if hum then
            hum.UseJumpPower = true
            hum.JumpPower = val and State.JumpPower or 0
            hum.JumpHeight = val and (State.JumpPower / 7) or 0
            hum:SetStateEnabled(Enum.HumanoidStateType.Jumping, val)
        end
    end,
})

TabMovement:CreateToggle({
    Name = "Infinite Stamina (Бесконечная выносливость)",
    CurrentValue = State.InfiniteStamina,
    Flag = "InfiniteStamina",
    Callback = function(val)
        State.InfiniteStamina = val
        if SprintingModule then
            SprintingModule.StaminaLossDisabled = val
            if val then SprintingModule.Stamina = SprintingModule.MaxStamina or 110 end
        end
    end,
})

TabMovement:CreateToggle({
    Name = "Infinite Jump (Бесконечный прыжок)",
    CurrentValue = State.InfiniteJump,
    Flag = "InfiniteJump",
    Callback = function(val)
        State.InfiniteJump = val
    end,
})

TabMovement:CreateToggle({
    Name = "Anti-Slow (Снятие замедлений)",
    CurrentValue = State.AntiSlow,
    Flag = "AntiSlow",
    Callback = function(val)
        State.AntiSlow = val
    end,
})

TabMovement:CreateToggle({
    Name = "Auto-Sprint (Бег без Shift)",
    CurrentValue = State.AutoSprint,
    Flag = "AutoSprint",
    Callback = function(val)
        State.AutoSprint = val
    end,
})

TabMovement:CreateSection("Values")

TabMovement:CreateSlider({
    Name = "Jump Power",
    Range = { 20, 120 },
    Increment = 5,
    CurrentValue = State.JumpPower,
    Flag = "JumpPower",
    Callback = function(val)
        State.JumpPower = val
        local myChar = LocalPlayer.Character
        local hum = myChar and myChar:FindFirstChildOfClass("Humanoid")
        if hum and State.ForcedJump then
            hum.UseJumpPower = true
            hum.JumpPower = val
            hum.JumpHeight = val / 7
        end
    end,
})

-- 2. COMBAT
local TabCombat = Window:CreateTab("Combat", "sword")
TabCombat:CreateSection("Auto Defense")

TabCombat:CreateToggle({
    Name = "Auto-Block (Парирование Q)",
    CurrentValue = State.AutoBlock,
    Flag = "AutoBlock",
    Callback = function(val)
        State.AutoBlock = val
    end,
})

TabCombat:CreateToggle({
    Name = "Auto-Avoid Killer (Авто-отталкивание)",
    CurrentValue = State.AutoAvoidKiller,
    Flag = "AutoAvoidKiller",
    Callback = function(val)
        State.AutoAvoidKiller = val
    end,
})

TabCombat:CreateSlider({
    Name = "Auto-Block Distance",
    Range = { 8, 22 },
    Increment = 1,
    Suffix = "m",
    CurrentValue = State.AutoBlockRange,
    Flag = "AutoBlockRange",
    Callback = function(val)
        State.AutoBlockRange = val
    end,
})

TabCombat:CreateSlider({
    Name = "Avoid Distance",
    Range = { 8, 30 },
    Increment = 1,
    Suffix = "m",
    CurrentValue = State.AutoAvoidKillerRange,
    Flag = "AutoAvoidKillerRange",
    Callback = function(val)
        State.AutoAvoidKillerRange = val
    end,
})

TabCombat:CreateSlider({
    Name = "Repel Force (Сила отталкивания)",
    Range = { 30, 140 },
    Increment = 5,
    CurrentValue = State.AvoidRepelForce,
    Flag = "AvoidRepelForce",
    Callback = function(val)
        State.AvoidRepelForce = val
    end,
})

TabCombat:CreateSection("Manual Avoid")

TabCombat:CreateKeybind({
    Name = "Avoid Impulse Keybind",
    CurrentKeybind = "V",
    HoldToInteract = false,
    Flag = "AvoidKeybind",
    Callback = function()
        ExecuteAvoidImpulse()
    end,
})

TabCombat:CreateButton({
    Name = "Manual Avoid Impulse (Рывок от маньяка)",
    Callback = function()
        ExecuteAvoidImpulse()
    end,
})

TabCombat:CreateSection("Triggerbot (Killer)")

TabCombat:CreateToggle({
    Name = "Triggerbot (Авто-аим и M1 маньяка)",
    CurrentValue = State.Triggerbot,
    Flag = "Triggerbot",
    Callback = function(val)
        State.Triggerbot = val
    end,
})

TabCombat:CreateSlider({
    Name = "Triggerbot Range",
    Range = { 6, 25 },
    Increment = 1,
    Suffix = "m",
    CurrentValue = State.TriggerbotRange,
    Flag = "TriggerbotRange",
    Callback = function(val)
        State.TriggerbotRange = val
    end,
})

TabCombat:CreateSlider({
    Name = "Triggerbot Cooldown",
    Range = { 0.1, 1.0 },
    Increment = 0.05,
    Suffix = "s",
    CurrentValue = State.TriggerbotCooldown,
    Flag = "TriggerbotCooldown",
    Callback = function(val)
        State.TriggerbotCooldown = val
    end,
})

-- 3. VISUALS
local TabVisuals = Window:CreateTab("Visuals", "eye")
TabVisuals:CreateSection("ESP")

TabVisuals:CreateToggle({
    Name = "Master ESP",
    CurrentValue = State.ESPEnabled,
    Flag = "ESPEnabled",
    Callback = function(val) State.ESPEnabled = val end,
})

TabVisuals:CreateToggle({
    Name = "Generators ESP",
    CurrentValue = State.GeneratorsESP,
    Flag = "GeneratorsESP",
    Callback = function(val) State.GeneratorsESP = val end,
})

TabVisuals:CreateToggle({
    Name = "Gears ESP",
    CurrentValue = State.GearsESP,
    Flag = "GearsESP",
    Callback = function(val) State.GearsESP = val end,
})

TabVisuals:CreateToggle({
    Name = "Traps ESP",
    CurrentValue = State.TrapsESP,
    Flag = "TrapsESP",
    Callback = function(val) State.TrapsESP = val end,
})

TabVisuals:CreateToggle({
    Name = "Items ESP",
    CurrentValue = State.ItemsESP,
    Flag = "ItemsESP",
    Callback = function(val) State.ItemsESP = val end,
})

TabVisuals:CreateToggle({
    Name = "Survivors ESP",
    CurrentValue = State.SurvivorsESP,
    Flag = "SurvivorsESP",
    Callback = function(val) State.SurvivorsESP = val end,
})

TabVisuals:CreateToggle({
    Name = "Killers ESP",
    CurrentValue = State.KillersESP,
    Flag = "KillersESP",
    Callback = function(val) State.KillersESP = val end,
})

TabVisuals:CreateToggle({
    Name = "Chams (Highlight)",
    CurrentValue = State.ChamsEnabled,
    Flag = "ChamsEnabled",
    Callback = function(val) State.ChamsEnabled = val end,
})

TabVisuals:CreateSection("Alerts & Camera")

TabVisuals:CreateToggle({
    Name = "Killer Proximity Alert",
    CurrentValue = State.KillerAlert,
    Flag = "KillerAlert",
    Callback = function(val) State.KillerAlert = val end,
})

TabVisuals:CreateSlider({
    Name = "Alert Distance",
    Range = { 30, 150 },
    Increment = 5,
    Suffix = "m",
    CurrentValue = State.KillerAlertDistance,
    Flag = "KillerAlertDistance",
    Callback = function(val) State.KillerAlertDistance = val end,
})

TabVisuals:CreateToggle({
    Name = "Fullbright & Anti-Fog",
    CurrentValue = State.Fullbright,
    Flag = "Fullbright",
    Callback = function(val)
        State.Fullbright = val
        if not val then
            Lighting.Ambient = OriginalLighting.Ambient
            Lighting.OutdoorAmbient = OriginalLighting.OutdoorAmbient
            Lighting.Brightness = OriginalLighting.Brightness
            Lighting.ClockTime = OriginalLighting.ClockTime
            Lighting.FogEnd = OriginalLighting.FogEnd
            Lighting.GlobalShadows = OriginalLighting.GlobalShadows
        end
    end,
})

TabVisuals:CreateToggle({
    Name = "Remove Dark Screen VFX",
    CurrentValue = State.RemoveVFX,
    Flag = "RemoveVFX",
    Callback = function(val) State.RemoveVFX = val end,
})

TabVisuals:CreateSlider({
    Name = "Field Of View (FOV)",
    Range = { 70, 120 },
    Increment = 1,
    CurrentValue = State.CustomFOV,
    Flag = "CustomFOV",
    Callback = function(val)
        State.CustomFOV = val
        if Camera then Camera.FieldOfView = val end
    end,
})

-- 4. PUZZLES & INTERACT
local TabPuzzles = Window:CreateTab("Puzzles", "puzzle")
TabPuzzles:CreateSection("Automation & Interact")

TabPuzzles:CreateToggle({
    Name = "Auto-Puzzle Solver (Все миниигры)",
    CurrentValue = State.AutoAllPuzzles,
    Flag = "AutoAllPuzzles",
    Callback = function(val) State.AutoAllPuzzles = val end,
})

TabPuzzles:CreateToggle({
    Name = "Instant Interact (0s Hold)",
    CurrentValue = State.InstantInteract,
    Flag = "InstantInteract",
    Callback = function(val)
        State.InstantInteract = val
        UpdateAllPrompts()
    end,
})

TabPuzzles:CreateToggle({
    Name = "Auto-Collect Items & Gears",
    CurrentValue = State.AutoProximityInteract,
    Flag = "AutoProximityInteract",
    Callback = function(val) State.AutoProximityInteract = val end,
})

TabPuzzles:CreateToggle({
    Name = "Proximity Range Spoof (30m)",
    CurrentValue = State.ProximitySpoofRange,
    Flag = "ProximitySpoofRange",
    Callback = function(val)
        State.ProximitySpoofRange = val
        UpdateAllPrompts()
    end,
})

TabPuzzles:CreateSection("Objective Teleports")

TabPuzzles:CreateButton({
    Name = "Teleport to Unfinished Generator",
    Callback = function()
        local myChar = LocalPlayer.Character
        local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")
        if not myHRP then return end

        local bestPart, minDist = nil, 999999
        local myPos = myHRP.Position

        for gen, part in pairs(GeneratorCache) do
            if gen and gen.Parent and part and part.Parent then
                if GetGeneratorProgress(gen) < 100 then
                    local dist = (part.Position - myPos).Magnitude
                    if dist < minDist then
                        minDist = dist
                        bestPart = part
                    end
                end
            end
        end

        if bestPart then
            myChar:PivotTo(bestPart.CFrame + Vector3.new(0, 3, 0))
            Notify("Generator", string.format("Телепортирован к генератору (%dм)", math.floor(minDist)), 2.5)
        else
            Notify("Generator", "Незавершенных генераторов поблизости нет.", 2.5)
        end
    end,
})

TabPuzzles:CreateButton({
    Name = "Teleport to Nearest Gear",
    Callback = function()
        local myChar = LocalPlayer.Character
        local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")
        if not myHRP then return end

        local bestPart, minDist = nil, 999999
        local myPos = myHRP.Position

        for gear, part in pairs(GearCache) do
            if gear and gear.Parent and part and part.Parent then
                local dist = (part.Position - myPos).Magnitude
                if dist < minDist then
                    minDist = dist
                    bestPart = part
                end
            end
        end

        if bestPart then
            myChar:PivotTo(bestPart.CFrame + Vector3.new(0, 3, 0))
            Notify("Gear", string.format("Телепортирован к гиру (%dм)", math.floor(minDist)), 2.5)
        else
            Notify("Gear", "Шестерёнки не найдены на текущей карте.", 2.5)
        end
    end,
})

-- 5. TELEPORT
local TabTeleport = Window:CreateTab("Teleport", "navigation")
TabTeleport:CreateSection("Players & Lobby")

TabTeleport:CreateButton({
    Name = "Teleport Behind Killer",
    Callback = function()
        local myChar = LocalPlayer.Character
        local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")
        if not myHRP then return end

        local killersFolder = workspace:FindFirstChild("Players") and workspace.Players:FindFirstChild("Killers")
        if killersFolder and #killersFolder:GetChildren() > 0 then
            local killer = killersFolder:GetChildren()[1]
            local hrp = killer:FindFirstChild("HumanoidRootPart")
            if hrp then
                myChar:PivotTo(hrp.CFrame * CFrame.new(0, 0, 5))
                Notify("Teleport", "Телепортирован к Killer: " .. killer.Name, 2.5)
                return
            end
        end
        Notify("Teleport", "Маньяк не найден.", 2.5)
    end,
})

TabTeleport:CreateButton({
    Name = "Teleport to Random Survivor",
    Callback = function()
        local myChar = LocalPlayer.Character
        local myHRP = myChar and myChar:FindFirstChild("HumanoidRootPart")
        if not myHRP then return end

        local survivorsFolder = workspace:FindFirstChild("Players") and workspace.Players:FindFirstChild("Survivors")
        if survivorsFolder then
            local list = {}
            for _, s in ipairs(survivorsFolder:GetChildren()) do
                if s ~= myChar and s:FindFirstChild("HumanoidRootPart") then
                    table.insert(list, s)
                end
            end
            if #list > 0 then
                local chosen = list[math.random(1, #list)]
                myChar:PivotTo(chosen.HumanoidRootPart.CFrame * CFrame.new(0, 0, 4))
                Notify("Teleport", "Телепортирован к Survivor: " .. chosen.Name, 2.5)
                return
            end
        end
        Notify("Teleport", "Живых выживших не найдено.", 2.5)
    end,
})

TabTeleport:CreateButton({
    Name = "Teleport to Lobby Spawn",
    Callback = function()
        local myChar = LocalPlayer.Character
        if not myChar then return end

        local spawnLoc = workspace:FindFirstChild("Map") and workspace.Map:FindFirstChild("Lobby") and workspace.Map.Lobby:FindFirstChild("Spawn")
        if spawnLoc then
            myChar:PivotTo(spawnLoc.CFrame + Vector3.new(0, 4, 0))
        else
            myChar:PivotTo(CFrame.new(-5742, 305, -2130))
        end
        Notify("Teleport", "Телепортирован в лобби.", 2.5)
    end,
})

-- 6. SETTINGS
local TabSettings = Window:CreateTab("Settings", "settings")
TabSettings:CreateSection("Script Actions")

TabSettings:CreateButton({
    Name = "Rejoin Server",
    Callback = function()
        TeleportService:TeleportToPlaceInstance(game.PlaceId, game.JobId, LocalPlayer)
    end,
})

TabSettings:CreateButton({
    Name = "Unload Script",
    Callback = function()
        if getgenv().ForsakenCleanup then
            getgenv().ForsakenCleanup()
        end
    end,
})

Notify("Forsaken Loaded", "Нажми F1 чтобы скрыть/открыть меню", 4.0)
Executor compatibility changes over time. Check current reports before testing.

Script #28 Working Script

Script #28 · Working ScriptFree
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")

local LocalPlayer = Players.LocalPlayer
local ATTRIBUTE = "SpectateTargetUserId"

local gui = Instance.new("ScreenGui")
gui.Name = "SpectatorNotifications"
gui.ResetOnSpawn = false
gui.Parent = LocalPlayer:WaitForChild("PlayerGui")

local holder = Instance.new("Frame")
holder.BackgroundTransparency = 1
holder.AnchorPoint = Vector2.new(1, 0)
holder.Position = UDim2.new(1, -15, 0, 15)
holder.Size = UDim2.new(0, 260, 1, -30)
holder.Parent = gui

local layout = Instance.new("UIListLayout")
layout.Padding = UDim.new(0, 6)
layout.SortOrder = Enum.SortOrder.LayoutOrder
layout.Parent = holder

local spectatorLabel = Instance.new("TextLabel")
spectatorLabel.Name = "SpectatorsLabel"
spectatorLabel.AnchorPoint = Vector2.new(0, 0)
spectatorLabel.Position = UDim2.new(0, 15, 0, 15)
spectatorLabel.Size = UDim2.new(0, 300, 0, 28)
spectatorLabel.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
spectatorLabel.BackgroundTransparency = 0.3
spectatorLabel.BorderSizePixel = 0
spectatorLabel.Font = Enum.Font.GothamMedium
spectatorLabel.TextSize = 14
spectatorLabel.TextColor3 = Color3.new(1, 1, 1)
spectatorLabel.TextXAlignment = Enum.TextXAlignment.Left
spectatorLabel.TextTruncate = Enum.TextTruncate.AtEnd
spectatorLabel.Text = "Spectators: None"
spectatorLabel.Parent = gui
Instance.new("UICorner", spectatorLabel).CornerRadius = UDim.new(0, 8)
local labelPadding = Instance.new("UIPadding", spectatorLabel)
labelPadding.PaddingLeft = UDim.new(0, 10)
labelPadding.PaddingRight = UDim.new(0, 10)

local order = 0

local function notify(text, color, duration)
	duration = duration or 3
	order += 1

	local frame = Instance.new("Frame")
	frame.LayoutOrder = order
	frame.Size = UDim2.new(1, 0, 0, 38)
	frame.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
	frame.BackgroundTransparency = 1
	frame.BorderSizePixel = 0
	frame.Parent = holder

	Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 8)

	local bar = Instance.new("Frame") -- colored accent on the left
	bar.Size = UDim2.new(0, 4, 1, 0)
	bar.BackgroundColor3 = color
	bar.BackgroundTransparency = 1
	bar.BorderSizePixel = 0
	bar.Parent = frame
	Instance.new("UICorner", bar).CornerRadius = UDim.new(0, 8)

	local label = Instance.new("TextLabel")
	label.BackgroundTransparency = 1
	label.Position = UDim2.new(0, 12, 0, 0)
	label.Size = UDim2.new(1, -18, 1, 0)
	label.Font = Enum.Font.GothamMedium
	label.TextSize = 14
	label.TextColor3 = Color3.new(1, 1, 1)
	label.TextTransparency = 1
	label.TextXAlignment = Enum.TextXAlignment.Left
	label.TextTruncate = Enum.TextTruncate.AtEnd
	label.Text = text
	label.Parent = frame

	local info = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	TweenService:Create(frame, info, { BackgroundTransparency = 0.15 }):Play()
	TweenService:Create(bar, info, { BackgroundTransparency = 0 }):Play()
	TweenService:Create(label, info, { TextTransparency = 0 }):Play()

	task.delay(duration, function()
		local out = TweenInfo.new(0.3)
		TweenService:Create(frame, out, { BackgroundTransparency = 1 }):Play()
		TweenService:Create(bar, out, { BackgroundTransparency = 1 }):Play()
		local fade = TweenService:Create(label, out, { TextTransparency = 1 })
		fade:Play()
		fade.Completed:Wait()
		frame:Destroy()
	end)
end

local spectators = {}

local function GetSpectators()
	local names = {}
	for plr in pairs(spectators) do
		table.insert(names, plr.Name)
	end
	return table.concat(names, ", ")
end

local function refreshLabel()
	local names = GetSpectators()
	spectatorLabel.Text = "Spectators: " .. (names ~= "" and names or "None")
end

local function updateSpectator(plr)
	if plr == LocalPlayer then return end

	local isSpectatingMe = plr:GetAttribute(ATTRIBUTE) == LocalPlayer.UserId

	if isSpectatingMe and not spectators[plr] then
		spectators[plr] = true
		refreshLabel()
		notify(plr.DisplayName .. " is now spectating you", Color3.fromRGB(80, 200, 120))
	elseif not isSpectatingMe and spectators[plr] then
		spectators[plr] = nil
		refreshLabel()
		notify(plr.DisplayName .. " stopped spectating you", Color3.fromRGB(220, 90, 90))
	end
end

local function trackPlayer(plr)
	if plr == LocalPlayer then return end

	plr:GetAttributeChangedSignal(ATTRIBUTE):Connect(function()
		updateSpectator(plr)
	end)

	updateSpectator(plr)
end

for _, plr in ipairs(Players:GetPlayers()) do
	trackPlayer(plr)
end

Players.PlayerAdded:Connect(trackPlayer)

Players.PlayerRemoving:Connect(function(plr)
	if spectators[plr] then
		spectators[plr] = nil
		refreshLabel()
		notify(plr.DisplayName .. " left (was spectating you)", Color3.fromRGB(220, 90, 90))
	end
end)
Executor compatibility changes over time. Check current reports before testing.

Script #29 Working Script

Script #29 · Working ScriptFree
local typeof_ = (type(typeof) == "function" and typeof) or type
local now = (type(time) == "function" and time) or os.clock
local getrawmetatable_ = getrawmetatable
local setreadonly_ = setreadonly
local newcclosure_ = newcclosure
local getnamecallmethod_ = getnamecallmethod
local hookfunction_ = hookfunction
local getgenv_ = getgenv
local shared_ = shared

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = Players.LocalPlayer

local registry = (type(getgenv_) == "function" and getgenv_())
    or (type(shared_) == "table" and shared_)
    or _G

local KEY = "__Split_AntiKick_InfStamina_Controller_v1__"
local existing = registry[KEY]
if type(existing) == "table" and type(existing.IsInstalled) == "function"
    and existing.IsInstalled() then
    existing.SetEnabled(true)
    return existing
end

local master, running = true, true
local loopToken = 0
local warned = {}

local function warnOnce(key, message)
    if warned[key] then return end
    warned[key] = true
    print("[anti_kick_inf_stamina] " .. key .. ": " .. tostring(message))
end

local function wrap(fn)
    if type(newcclosure_) == "function" then return newcclosure_(fn) end
    return fn
end

local function unlock(mt)
    if type(setreadonly_) == "function" then setreadonly_(mt, false) end
end

local function lock(mt)
    if type(setreadonly_) == "function" then setreadonly_(mt, true) end
end

local function child(parent, name)
    if not parent then return nil end
    return parent:FindFirstChild(name)
end

local function safeRequire(module)
    local ok, value = pcall(require, module)
    if not ok or type(value) ~= "table" then return nil, tostring(value) end
    return value
end

local sprintingCache = nil
local nextSprintingAt = 0
local resolveRetry, errorRetry = 0.25, 0.5

local function resolveSprinting(t)
    if sprintingCache then return sprintingCache end
    if t < nextSprintingAt then return nil end
    local systems = child(ReplicatedStorage, "Systems")
    local character = child(systems, "Character")
    local gameplay = child(character, "Game")
    local module = child(gameplay, "Sprinting")
    if not module then
        nextSprintingAt = t + resolveRetry
        return nil
    end
    local value, err = safeRequire(module)
    if not value then
        nextSprintingAt = t + errorRetry
        warnOnce("sprinting", "Sprinting require failed: " .. tostring(err))
        return nil
    end
    sprintingCache = value
    return value
end

local KF = {
    enabled = true,
    installed = false,
    unavailable = nil,
    reason = "Stamina exceeds max possible cap",
}
KF.reasonLower = string.lower(KF.reason)

local mt, originalNamecall, namecallHook
local originalKick, kickTarget
local directHooked, namecallHooked = false, false

local function kfActive()
    return master and KF.enabled and KF.installed
end

local function matches(reason)
    if not kfActive() or typeof_(reason) ~= "string" then return false end
    if string.find(reason, KF.reason, 1, true) then return true end
    return string.find(string.lower(reason), KF.reasonLower, 1, true) ~= nil
end

local function kfRollbackDirect()
    if directHooked and kickTarget and originalKick
        and type(hookfunction_) == "function" then
        pcall(hookfunction_, kickTarget, originalKick)
    end
    directHooked = false
end

local function kfInstall()
    if KF.installed then return true end
    if type(getrawmetatable_) ~= "function"
        or type(getnamecallmethod_) ~= "function" then
        KF.unavailable = "getrawmetatable / getnamecallmethod unavailable"
        warnOnce("kickfilter", KF.unavailable)
        return false
    end
    mt = getrawmetatable_(game)
    if not mt or not mt.__namecall then
        KF.unavailable = "__namecall unavailable"
        warnOnce("kickfilter", KF.unavailable)
        return false
    end
    if type(hookfunction_) == "function" and player.Kick ~= nil then
        local target = player.Kick
        local ok, original = pcall(hookfunction_, target, function(self, reason)
            if self == player and matches(reason) then return end
            if originalKick then return originalKick(self, reason) end
        end)
        if ok and original then
            originalKick, kickTarget, directHooked = original, target, true
        end
    end
    originalNamecall = mt.__namecall
    namecallHook = wrap(function(self, ...)
        if getnamecallmethod_() == "Kick" and self == player then
            local reason = ...
            if matches(reason) then return end
        end
        return originalNamecall(self, ...)
    end)
    local ok = pcall(function()
        unlock(mt)
        mt.__namecall = namecallHook
        lock(mt)
    end)
    if not ok then
        kfRollbackDirect()
        KF.unavailable = "failed to install __namecall hook"
        warnOnce("kickfilter", KF.unavailable)
        return false
    end
    namecallHooked = true
    KF.installed = true
    KF.unavailable = nil
    return true
end

local function kfStop()
    KF.installed = false
    if namecallHooked and namecallHook and mt.__namecall == namecallHook then
        pcall(function()
            unlock(mt)
            mt.__namecall = originalNamecall
            lock(mt)
        end)
    end
    kfRollbackDirect()
    namecallHooked = false
    namecallHook = nil
end

local ST = {
    enabled = true,
    installed = false,
    unavailable = nil,
    Settings = {
        InfiniteStamina = true,
        MinStaminaValue = 0,
        MaxStaminaValue = 100,
        DrainStaminaValue = 10,
        RefillThreshold = 2,
        PollInterval = 0.1,
        IdleInterval = 0.25,
        ErrorBackoff = 1.0,
        MaxConsecutiveErrors = 5,
        ResolveRetry = 0.25,
    },
}

local FIELDS = {
    "MinStamina", "MaxStamina", "StaminaDrain",
    "StaminaLoss", "StaminaLossDisabled", "Stamina",
}
local saved = nil
local consecutiveErrors = 0

local function stActive()
    return running and master and ST.enabled and ST.installed
        and ST.Settings.InfiniteStamina
end

local function stSnapshot(m)
    if saved and saved.module == m then return end
    local values = {}
    for _, key in ipairs(FIELDS) do values[key] = m[key] end
    saved = { module = m, values = values }
end

local function stRestore()
    if not saved then return end
    for _, key in ipairs(FIELDS) do
        saved.module[key] = saved.values[key]
    end
    saved = nil
end

local function setField(m, key, value, existingOnly)
    local current = m[key]
    if existingOnly and current == nil then return end
    if current ~= value then m[key] = value end
end

local function staminaParts(m)
    local value = m.Stamina
    if typeof_(value) == "number" then return value, nil end
    if value ~= nil and (typeof_(value) == "Instance" or typeof_(value) == "table") then
        local ok, inner = pcall(function() return value.Value end)
        if ok and typeof_(inner) == "number" then return inner, value end
    end
    return nil, nil
end

local function stUpdate(m)
    stSnapshot(m)
    setField(m, "MinStamina", ST.Settings.MinStaminaValue)
    setField(m, "MaxStamina", ST.Settings.MaxStaminaValue)
    setField(m, "StaminaDrain", ST.Settings.DrainStaminaValue, true)
    setField(m, "StaminaLoss", ST.Settings.DrainStaminaValue, true)
    setField(m, "StaminaLossDisabled", false)
    local current, container = staminaParts(m)
    if current and current <= ST.Settings.RefillThreshold then
        local maximum = m.MaxStamina
        if typeof_(maximum) ~= "number" then maximum = ST.Settings.MaxStaminaValue end
        if container then container.Value = maximum else m.Stamina = maximum end
    end
end

local function stLoop()
    loopToken = loopToken + 1
    local myToken = loopToken
    while running and loopToken == myToken do
        local interval = stActive() and ST.Settings.PollInterval or ST.Settings.IdleInterval
        task.wait(interval)
        if not (running and loopToken == myToken) then break end
        if not stActive() then
            stRestore()
            consecutiveErrors = 0
        else
            local m = resolveSprinting(now())
            if m then
                local ok, failure = pcall(stUpdate, m)
                if ok then
                    consecutiveErrors = 0
                else
                    consecutiveErrors = consecutiveErrors + 1
                    warnOnce("stamina", "update error: " .. tostring(failure))
                    if consecutiveErrors >= ST.Settings.MaxConsecutiveErrors then
                        task.wait(ST.Settings.ErrorBackoff)
                        consecutiveErrors = 0
                    end
                end
            end
        end
    end
end

local function stInstall()
    if ST.installed then return true end
    ST.installed = true
    ST.unavailable = nil
    task.spawn(stLoop)
    return true
end

local function stStop()
    ST.installed = false
    loopToken = loopToken + 1
    stRestore()
    consecutiveErrors = 0
end

local controller = {}

local KickFilter = {
    SetEnabled = function(value) KF.enabled = not not value end,
    IsEnabled = function() return KF.enabled end,
    IsInstalled = function() return KF.installed end,
    SetReason = function(value)
        assert(typeof_(value) == "string" and value ~= "",
            "reason must be a non-empty string")
        KF.reason = value
        KF.reasonLower = string.lower(value)
    end,
    GetReason = function() return KF.reason end,
    Status = function()
        return {
            Enabled = KF.enabled,
            Installed = KF.installed,
            Reason = KF.reason,
            Unavailable = KF.unavailable,
        }
    end,
}

local InfiniteStamina = {
    Settings = ST.Settings,
    SetEnabled = function(value) ST.enabled = not not value end,
    IsEnabled = function() return ST.enabled and ST.Settings.InfiniteStamina end,
    IsInstalled = function() return ST.installed end,
    Restore = function() stRestore() end,
    Status = function()
        return {
            Enabled = ST.enabled,
            Installed = ST.installed,
            Active = stActive(),
            ModuleResolved = sprintingCache ~= nil,
        }
    end,
}

controller.KickFilter = KickFilter
controller.InfiniteStamina = InfiniteStamina
controller.Settings = ST.Settings
controller.SetReason = KickFilter.SetReason
controller.GetReason = KickFilter.GetReason

function controller.IsEnabled()
    return master
end

function controller.IsInstalled()
    return KF.installed or ST.installed
end

function controller.SetEnabled(value)
    master = not not value
    if not master then stRestore() end
end

function controller.Status()
    return {
        Enabled = master,
        KickFilter = KickFilter.Status(),
        InfiniteStamina = InfiniteStamina.Status(),
        Modules = { Sprinting = sprintingCache ~= nil },
    }
end

function controller.Stop()
    master = false
    running = false
    loopToken = loopToken + 1
    kfStop()
    stStop()
    sprintingCache = nil
    nextSprintingAt = 0
    saved = nil
    registry[KEY] = nil
end

function controller.Restart()
    if KF.installed or ST.installed then return true end
    master = true
    running = true
    KF.enabled, ST.enabled = true, true
    ST.Settings.InfiniteStamina = true
    nextSprintingAt = 0
    saved = nil
    return controller._install()
end

function controller._install()
    kfInstall()
    stInstall()
    registry[KEY] = controller
    return true
end

assert(controller._install(), "failed to install anti kick and infinite stamina")
return controller
Executor compatibility changes over time. Check current reports before testing.

Script #30 Auto Generator & More

Script #30 · Auto Generator & MoreFree
Auto GeneratorGenerator Cooldown SliderFlow Minigame SolverConnect Minigame SolverLock Minigame SolverGear Minigame Solver
loadstring(game:HttpGet("https://gist.githubusercontent.com/ReefHubOfficial/b15e9fb62d6adefe53dd06aa2e5b394d/raw/79103f2afa82b3919385303a201062d1e3a35093/Forsaken"))()
Executor compatibility changes over time. Check current reports before testing.

Script #31 Retro Anim & More (UFE / F:FFA Update)

Script #31 · Retro Anim & MoreFree
Retro Anim
local Players = game:GetService("Players")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local animate = character:WaitForChild("Animate")

-- CUSTOM NORMAL ANIMATIONS
local IDLE_ANIMATION = "rbxassetid://116749890592091"
local WALK_ANIMATION = "rbxassetid://90226466808163"
local RUN_ANIMATION = "rbxassetid://112590720308155"

-- ==========================================
-- IDLE
-- ==========================================

animate:WaitForChild("idle")
	:WaitForChild("Animation1").AnimationId = IDLE_ANIMATION

-- ==========================================
-- WALK
-- ==========================================

local walk = animate:WaitForChild("walk")

local walkAnimation =
	walk:FindFirstChild("WalkAnim")
	or walk:FindFirstChild("WalkAnimation")

if walkAnimation and walkAnimation:IsA("Animation") then
	walkAnimation.AnimationId = WALK_ANIMATION
else
	warn("CUSTOM ANIMATION: Walk animation object not found!")
end

-- ==========================================
-- RUN
-- ==========================================

local run = animate:WaitForChild("run")

local runAnimation =
	run:FindFirstChild("RunAnim")
	or run:FindFirstChild("RunAnimation")

if runAnimation and runAnimation:IsA("Animation") then
	runAnimation.AnimationId = RUN_ANIMATION
else
	warn("CUSTOM ANIMATION: Run animation object not found!")
end

-- ==========================================
-- INJURED ANIMATIONS
-- LEFT COMPLETELY UNCHANGED
-- ==========================================
Executor compatibility changes over time. Check current reports before testing.

Script #32 Killer Bot & More (works well Update)

Script #32 · Killer Bot & MoreFree
Killer BotControls
loadstring(game:HttpGet("https://pastefy.app/Au1wV9nQ/raw"))()
Executor compatibility changes over time. Check current reports before testing.

Script #33 Some ******** I Made & More

Script #33 · Some ******** I Made & MoreFree
Some ******** I Made
loadstring(game:HttpGet("https://raw.githubusercontent.com/Funnikid69/looking-for-something/refs/heads/main/NovalightScriptBeta.luau"))()
Executor compatibility changes over time. Check current reports before testing.

Script #34 Working Script

Script #34 · Working ScriptFree
loadstring(game:HttpGet("https://raw.githubusercontent.com/meogaming2025/Script/refs/heads/main/Forsaken/Chance%20Aimbot%20Version%203.lua"))()
Executor compatibility changes over time. Check current reports before testing.

Updated and tested for the latest works well Update, this script automates the newest event tasks so you can keep up without the extra grind.

Updated and tested for the latest UFE / F:FFA Update, this script automates the newest event tasks so you can keep up without the extra grind.

Updated and tested for the latest works well Update, this script automates the newest event tasks so you can keep up without the extra grind.

Updated and tested for the latest Kinda garbage tho Update, this script automates the newest event tasks so you can keep up without the extra grind.

Updated and tested for the latest Update , this script automates the newest event tasks so you can keep up without the extra grind.

[ALPHA] Forsaken Script Features:

Here’s the full list of features that Forsaken scripts offer:

  • ESP – See through walls, cool!
  • Change Sprinting Values – Run faster or longer!

How to use scripts?

  • Download a Script Executor – Tools like AWP.GG, Delta, Hydrogen, Kiwi, Fluxus, or Codex.
  • Attach the Executor – Connect the tool to the game process.
  • Paste the Script – Load and execute the Lua script inside the game.
  • Activate Features – Tap the execute icon to use the injected script for custom actions.

Game Details:

  • Name: Forsaken
  • Developer: souldrivenlove
  • Maturity: Mild
  • Genre: Survival
  • Subgenre: 1 vs All

Frequently Asked Questions

What is a Forsaken script?

A Forsaken script is third-party Lua code intended to run alongside the Roblox game through a compatible script executor.

What features does this Forsaken script include?

Different scripts contain different code. This version includes: Auto Farm, Kill Aura, ESP, Aimbot, Silent Aim, Teleport, Speed Boost, Fly, Noclip, God Mode, Infinite Jump, Auto Collect, Anti-AFK.

How do you use the Forsaken script?

Pick a compatible executor such as Hydrogen, MacSploit, AWP.GG, Delta, Fluxus, Codex, launch Roblox and join the game, copy the complete Lua code from the script card above, paste it into the executor’s editor, and click Run or Execute. Compatibility changes over time, so a name here doesn’t guarantee current support.

Can a Forsaken script get your Roblox account banned?

Yes. Third-party scripts can violate Roblox rules and may put an account at risk. Only use code from a source you trust, never enter your Roblox password into a script or executor, and test on an alternate account first.

Does the Forsaken script work on mobile?

Check whether both the executor and the script support your device and the current Roblox version. Mobile executor support does not guarantee that every script will work.

Check out our Roblox Scripts hub and Roblox Games Directory for more.