Загрузка данных


-- ============================================================
-- Blood Engine | LinoriaLib GUI Script
-- Поддержка: ProjectReal / Synapse X / Execution Environment
-- ============================================================

-- Сервисы
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Workspace = game:GetService("Workspace")
local Lighting = game:GetService("Lighting")

local LocalPlayer = Players.LocalPlayer
local Camera = Workspace.CurrentCamera

-- ============================================================
-- 1. ЗАГРУЗКА LINORIA LIB И ADDONS
-- ============================================================

local repo = 'https://raw.githubusercontent.com/violin-suzutsuki/LinoriaLib/main/'

local Library = loadstring(game:HttpGet(repo .. 'Library.lua'))()
local ThemeManager = loadstring(game:HttpGet(repo .. 'addons/ThemeManager.lua'))()
local SaveManager = loadstring(game:HttpGet(repo .. 'addons/SaveManager.lua'))()

-- ============================================================
-- 2. СОЗДАНИЕ ОКНА
-- ============================================================

local Window = Library:CreateWindow({
    Title = 'Blood Engine | Cheat Menu',
    Center = true,
    AutoShow = true,
    TabPadding = 8,
    MenuFadeTime = 0.2
})

-- ============================================================
-- 3. ВКЛАДКИ
-- ============================================================

local Tabs = {
    Combat = Window:AddTab('Combat / Character'),
    Visuals = Window:AddTab('Visuals (ESP)'),
    Weapon = Window:AddTab('Weapon / Mechanics'),
    ['UI Settings'] = Window:AddTab('UI Settings')
}

-- ============================================================
-- 4. ЛОКАЛЬНЫЕ ПЕРЕМЕННЫЕ СОСТОЯНИЯ
-- ============================================================

local State = {
    Godmode = false,
    WalkSpeed = false,
    JumpPower = false,
    InfiniteStamina = false,
    ESP = false,
    ESP_Box = true,
    ESP_Name = true,
    ESP_Distance = true,
    ESP_Health = true,
    ESP_Color = Color3.fromRGB(255, 255, 255),
    Chams = false,
    Chams_Color = Color3.fromRGB(255, 0, 0),
    NoRecoil = false,
    NoSpread = false,
    FastReload = false,
    InstantAction = false
}

-- Хранилище ESP-объектов
local ESPObjects = {}
local ChamsObjects = {}

-- ============================================================
-- 5. ХУКИ ДЛЯ ОБХОДА АНТИ-ЧИТА
-- ============================================================

-- Безопасный getrawmetatable
local getRawMeta = getrawmetatable or getrawmetatable
local setReadOnly = setreadonly or setreadonly

-- Хук __namecall для перехвата Kick и других нежелательных вызовов
if getRawMeta and setReadOnly then
    local mt = getRawMeta(game)
    if mt then
        setReadOnly(mt, false)
        local oldNamecall = mt.__namecall

        mt.__namecall = newcclosure(function(self, ...)
            local method = getnamecallmethod()
            local args = { ... }

            -- Блокировка Kick
            if method == "Kick" or tostring(self) == "Kick" then
                warn("[Anti-Cheat Bypass] Kick attempt blocked.")
                return
            end

            -- Блокировка сообщений об ошибках / логах
            if method == "FireServer" and self.Name and (
                self.Name:lower():find("kick") or
                self.Name:lower():find("ban") or
                self.Name:lower():find("log") or
                self.Name:lower():find("report")
            ) then
                warn("[Anti-Cheat Bypass] Suspicious remote blocked:", self.Name)
                return
            end

            return oldNamecall(self, ...)
        end)

        setReadOnly(mt, true)
    end
end

-- ============================================================
-- 6. COMBAT / CHARACTER
-- ============================================================

local CombatGroup = Tabs.Combat:AddLeftGroupbox('Character')

-- Godmode / Infinite Health
CombatGroup:AddToggle('Godmode', {
    Text = 'Godmode / Infinite Health',
    Default = false,
    Tooltip = 'Блокирует урон по локальному персонажу',
    Callback = function(Value)
        State.Godmode = Value
        if Value then
            -- Пытаемся найти Humanoid
            local char = LocalPlayer.Character
            if char then
                local hum = char:FindFirstChildOfClass('Humanoid')
                if hum then
                    -- Устанавливаем здоровье на максимум и замораживаем
                    hum.MaxHealth = math.huge
                    hum.Health = hum.MaxHealth
                end
            end
        end
    end
})

-- SpeedHack (WalkSpeed)
local SpeedGroup = Tabs.Combat:AddRightGroupbox('Movement')

SpeedGroup:AddSlider('WalkSpeed', {
    Text = 'WalkSpeed',
    Default = 16,
    Min = 0,
    Max = 200,
    Rounding = 1,
    Compact = false,
    Callback = function(Value)
        State.WalkSpeed = Value
        if State.WalkSpeed and LocalPlayer.Character then
            local hum = LocalPlayer.Character:FindFirstChildOfClass('Humanoid')
            if hum then
                hum.WalkSpeed = Value
            end
        end
    end
})

SpeedGroup:AddToggle('WalkSpeedEnabled', {
    Text = 'Enable WalkSpeed Override',
    Default = false,
    Tooltip = 'Принудительно устанавливает WalkSpeed каждый кадр',
    Callback = function(Value)
        State.WalkSpeed = Value
    end
})

-- JumpPower
SpeedGroup:AddSlider('JumpPower', {
    Text = 'JumpPower',
    Default = 50,
    Min = 0,
    Max = 500,
    Rounding = 1,
    Compact = false,
    Callback = function(Value)
        State.JumpPower = Value
        if State.JumpPower and LocalPlayer.Character then
            local hum = LocalPlayer.Character:FindFirstChildOfClass('Humanoid')
            if hum then
                hum.JumpPower = Value
            end
        end
    end
})

SpeedGroup:AddToggle('JumpPowerEnabled', {
    Text = 'Enable JumpPower Override',
    Default = false,
    Callback = function(Value)
        State.JumpPower = Value
    end
})

-- Infinite Stamina / No Fatigue
CombatGroup:AddToggle('InfiniteStamina', {
    Text = 'Infinite Stamina / No Fatigue',
    Default = false,
    Tooltip = 'Сбрасывает стамину в Blood Engine',
    Callback = function(Value)
        State.InfiniteStamina = Value
    end
})

-- ============================================================
-- 7. VISUALS (ESP)
-- ============================================================

local VisualsGroup = Tabs.Visuals:AddLeftGroupbox('Player ESP')

-- ESP Toggle
VisualsGroup:AddToggle('ESP', {
    Text = 'Enable ESP',
    Default = false,
    Tooltip = 'Показывает игроков через стены',
    Callback = function(Value)
        State.ESP = Value
    end
})

-- ESP Sub-options
VisualsGroup:AddToggle('ESP_Box', {
    Text = 'Boxes',
    Default = true,
    Callback = function(Value) State.ESP_Box = Value end
})

VisualsGroup:AddToggle('ESP_Name', {
    Text = 'Names',
    Default = true,
    Callback = function(Value) State.ESP_Name = Value end
})

VisualsGroup:AddToggle('ESP_Distance', {
    Text = 'Distance',
    Default = true,
    Callback = function(Value) State.ESP_Distance = Value end
})

VisualsGroup:AddToggle('ESP_Health', {
    Text = 'Health Bars',
    Default = true,
    Callback = function(Value) State.ESP_Health = Value end
})

-- ESP ColorPicker
VisualsGroup:AddLabel('ESP Color'):AddColorPicker('ESP_Color', {
    Default = Color3.fromRGB(255, 255, 255),
    Title = 'ESP Color',
    Transparency = 0,
    Callback = function(Value)
        State.ESP_Color = Value
        -- Обновляем все существующие ESP
        for _, esp in pairs(ESPObjects) do
            if esp.Box and esp.Box.Parent then
                esp.Box.Color = Value
            end
        end
    end
})

-- Chams / Highlight
local ChamsGroup = Tabs.Visuals:AddRightGroupbox('Chams / Highlight')

ChamsGroup:AddToggle('Chams', {
    Text = 'Enable Chams / Highlight',
    Default = false,
    Tooltip = 'Подсвечивает персонажей игроков',
    Callback = function(Value)
        State.Chams = Value
    end
})

ChamsGroup:AddLabel('Chams Color'):AddColorPicker('Chams_Color', {
    Default = Color3.fromRGB(255, 0, 0),
    Title = 'Chams Color',
    Transparency = 0.5,
    Callback = function(Value)
        State.Chams_Color = Value
        for _, chams in pairs(ChamsObjects) do
            if chams and chams.Parent then
                chams.FillColor = Value
            end
        end
    end
})

-- ============================================================
-- 8. WEAPON / MECHANICS
-- ============================================================

local WeaponGroup = Tabs.Weapon:AddLeftGroupbox('Weapon Mods')

WeaponGroup:AddToggle('NoRecoil', {
    Text = 'No Recoil',
    Default = false,
    Tooltip = 'Убирает отдачу оружия',
    Callback = function(Value)
        State.NoRecoil = Value
    end
})

WeaponGroup:AddToggle('NoSpread', {
    Text = 'No Spread',
    Default = false,
    Tooltip = 'Убирает разброс',
    Callback = function(Value)
        State.NoSpread = Value
    end
})

WeaponGroup:AddToggle('FastReload', {
    Text = 'Fast Reload',
    Default = false,
    Tooltip = 'Ускоряет перезарядку',
    Callback = function(Value)
        State.FastReload = Value
    end
})

WeaponGroup:AddToggle('InstantAction', {
    Text = 'Instant Action',
    Default = false,
    Tooltip = 'Мгновенное действие',
    Callback = function(Value)
        State.InstantAction = Value
    end
})

-- ============================================================
-- 9. UI SETTINGS (SaveManager + ThemeManager)
-- ============================================================

local SettingsGroup = Tabs['UI Settings']:AddLeftGroupbox('Menu')

SettingsGroup:AddButton({
    Text = 'Save Config',
    Func = function()
        SaveManager:Save()
    end,
    DoubleClick = false,
    Tooltip = 'Сохранить текущие настройки'
})

SettingsGroup:AddButton({
    Text = 'Load Config',
    Func = function()
        SaveManager:Load()
    end,
    DoubleClick = false,
    Tooltip = 'Загрузить последний конфиг'
})

SettingsGroup:AddButton({
    Text = 'Load Autoload Config',
    Func = function()
        SaveManager:LoadAutoloadConfig()
    end,
    DoubleClick = false,
    Tooltip = 'Загрузить автоконфиг'
})

-- Dropdown для тем
local ThemeDropdown = Tabs['UI Settings']:AddRightGroupbox('Theme'):AddDropdown('ThemeDropdown', {
    Values = ThemeManager:GetThemes(),
    Default = 1,
    Text = 'Select Theme',
    Tooltip = 'Выберите тему оформления',
    Callback = function(Value)
        ThemeManager:SetTheme(Value)
    end
})

-- ============================================================
-- 10. ИНТЕГРАЦИЯ SAVE MANAGER / THEME MANAGER
-- ============================================================

-- ThemeManager
ThemeManager:SetLibrary(Library)
ThemeManager:SetFolder('BloodEngineCheat')
ThemeManager:ApplyToTab(Tabs['UI Settings'])

-- SaveManager
SaveManager:SetLibrary(Library)
SaveManager:SetFolder('BloodEngineCheat')
SaveManager:SetIgnoreIndexes({})
SaveManager:BuildConfigSection(Tabs['UI Settings'])

-- Автозагрузка последнего конфига
SaveManager:LoadAutoloadConfig()

-- ============================================================
-- 11. ОСНОВНОЙ ЦИКЛ (ESP, CHAMS, CHARACTER)
-- ============================================================

-- Вспомогательная функция: получение HumanoidRootPart
local function getRoot(plr)
    if not plr or not plr.Character then return nil end
    local root = plr.Character:FindFirstChild('HumanoidRootPart')
    return root
end

-- Вспомогательная функция: получение Humanoid
local function getHum(plr)
    if not plr or not plr.Character then return nil end
    local hum = plr.Character:FindFirstChildOfClass('Humanoid')
    return hum
end

-- ============================================================
-- 11.1. ESP (Box, Name, Distance, Health)
-- ============================================================

local function createESP(player)
    if player == LocalPlayer then return end

    -- Highlight (Chams)
    local highlight = Instance.new('Highlight')
    highlight.Name = 'BE_Chams'
    highlight.FillColor = State.Chams_Color
    highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
    highlight.FillTransparency = 0.5
    highlight.OutlineTransparency = 0
    highlight.Parent = player.Character
    highlight.Enabled = State.Chams
    ChamsObjects[player] = highlight

    -- ESP Box (Drawing API)
    local box = Drawing.new('Square')
    box.Thickness = 1
    box.Color = State.ESP_Color
    box.Filled = false
    box.Transparency = 1
    box.Visible = false

    -- Name
    local nameTag = Drawing.new('Text')
    nameTag.Size = 14
    nameTag.Center = true
    nameTag.Outline = true
    nameTag.Color = State.ESP_Color
    nameTag.Visible = false

    -- Distance
    local distTag = Drawing.new('Text')
    distTag.Size = 12
    distTag.Center = true
    distTag.Outline = true
    distTag.Color = Color3.fromRGB(255, 255, 255)
    distTag.Visible = false

    -- Health Bar
    local healthBarBg = Drawing.new('Rectangle')
    healthBarBg.Filled = true
    healthBarBg.Color = Color3.fromRGB(0, 0, 0)
    healthBarBg.Transparency = 1
    healthBarBg.Visible = false

    local healthBar = Drawing.new('Rectangle')
    healthBar.Filled = true
    healthBar.Color = Color3.fromRGB(0, 255, 0)
    healthBar.Transparency = 1
    healthBar.Visible = false

    ESPObjects[player] = {
        Box = box,
        Name = nameTag,
        Distance = distTag,
        HealthBarBg = healthBarBg,
        HealthBar = healthBar,
        Chams = highlight
    }
end

-- Удаление ESP
local function removeESP(player)
    local esp = ESPObjects[player]
    if esp then
        for _, obj in pairs(esp) do
            if obj and obj.Remove then
                obj:Remove()
            elseif obj and obj.Destroy then
                obj:Destroy()
            end
        end
        ESPObjects[player] = nil
    end

    local chams = ChamsObjects[player]
    if chams then
        chams:Destroy()
        ChamsObjects[player] = nil
    end
end

-- Инициализация ESP для всех игроков
for _, plr in ipairs(Players:GetPlayers()) do
    if plr ~= LocalPlayer and plr.Character then
        createESP(plr)
    end
end

-- Отслеживание новых игроков
Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        task.wait(1)
        createESP(plr)
    end)
end)

Players.PlayerRemoving:Connect(function(plr)
    removeESP(plr)
end)

-- ============================================================
-- 11.2. RENDER LOOP
-- ============================================================

RunService.RenderStepped:Connect(function()
    -- Обновление ESP
    for player, esp in pairs(ESPObjects) do
        if not player or not player.Parent then
            removeESP(player)
            continue
        end

        local root = getRoot(player)
        local hum = getHum(player)

        if not root or not hum or hum.Health <= 0 then
            -- Скрываем все элементы
            if esp.Box then esp.Box.Visible = false end
            if esp.Name then esp.Name.Visible = false end
            if esp.Distance then esp.Distance.Visible = false end
            if esp.HealthBarBg then esp.HealthBarBg.Visible = false end
            if esp.HealthBar then esp.HealthBar.Visible = false end
            continue
        end

        -- Позиция на экране
        local screenPos, onScreen = Camera:WorldToViewportPoint(root.Position)
        if not onScreen then
            if esp.Box then esp.Box.Visible = false end
            if esp.Name then esp.Name.Visible = false end
            if esp.Distance then esp.Distance.Visible = false end
            if esp.HealthBarBg then esp.HealthBarBg.Visible = false end
            if esp.HealthBar then esp.HealthBar.Visible = false end
            continue
        end

        -- Размер бокса
        local size = root.Size
        local topLeft = Camera:WorldToViewportPoint(root.Position + Vector3.new(0, size.Y / 2, 0))
        local bottomRight = Camera:WorldToViewportPoint(root.Position - Vector3.new(0, size.Y / 2, 0))

        local height = math.abs(topLeft.Y - bottomRight.Y)
        local width = height * 0.6

        local boxPos = Vector2.new(screenPos.X - width / 2, screenPos.Y - height / 2)

        -- Box
        if esp.Box then
            esp.Box.Visible = State.ESP and State.ESP_Box
            if esp.Box.Visible then
                esp.Box.Size = Vector2.new(width, height)
                esp.Box.Position = boxPos
                esp.Box.Color = State.ESP_Color
            end
        end

        -- Name
        if esp.Name then
            esp.Name.Visible = State.ESP and State.ESP_Name
            if esp.Name.Visible then
                esp.Name.Text = player.Name
                esp.Name.Position = Vector2.new(screenPos.X, boxPos.Y - 16)
                esp.Name.Color = State.ESP_Color
            end
        end

        -- Distance
        if esp.Distance then
            esp.Distance.Visible = State.ESP and State.ESP_Distance
            if esp.Distance.Visible then
                local dist = math.floor((Camera.CFrame.Position - root.Position).Magnitude)
                esp.Distance.Text = dist .. ' studs'
                esp.Distance.Position = Vector2.new(screenPos.X, boxPos.Y + height + 4)
            end
        end

        -- Health Bar
        if esp.HealthBarBg and esp.HealthBar then
            local healthPercent = math.clamp(hum.Health / hum.MaxHealth, 0, 1)
            esp.HealthBarBg.Visible = State.ESP and State.ESP_Health
            esp.HealthBar.Visible = State.ESP and State.ESP_Health
            if esp.HealthBar.Visible then
                local barHeight = height
                local barWidth = 4
                local barX = boxPos.X - barWidth - 2
                local barY = boxPos.Y

                esp.HealthBarBg.Size = Vector2.new(barWidth, barHeight)
                esp.HealthBarBg.Position = Vector2.new(barX, barY)
                esp.HealthBarBg.Color = Color3.fromRGB(0, 0, 0)

                esp.HealthBar.Size = Vector2.new(barWidth, barHeight * healthPercent)
                esp.HealthBar.Position = Vector2.new(barX, barY + (barHeight * (1 - healthPercent)))
                esp.HealthBar.Color = Color3.fromRGB(0, 255, 0):Lerp(Color3.fromRGB(255, 0, 0), 1 - healthPercent)
            end
        end

        -- Chams
        if esp.Chams then
            esp.Chams.Enabled = State.Chams
            if State.Chams then
                esp.Chams.FillColor = State.Chams_Color
            end
        end
    end

    -- Обновление движения (WalkSpeed / JumpPower)
    local char = LocalPlayer.Character
    if char then
        local hum = char:FindFirstChildOfClass('Humanoid')
        if hum and hum.Health > 0 then
            if State.WalkSpeed then
                hum.WalkSpeed = State.WalkSpeed
            end
            if State.JumpPower then
                hum.JumpPower = State.JumpPower
            end
        end
    end
end)

-- ============================================================
-- 11.3. HEARTBEAT LOOP (Godmode, Infinite Stamina, Weapon)
-- ============================================================

RunService.Heartbeat:Connect(function()
    local char = LocalPlayer.Character
    if not char then return end

    local hum = char:FindFirstChildOfClass('Humanoid')
    if not hum or hum.Health <= 0 then return end

    -- Godmode
    if State.Godmode then
        hum.MaxHealth = math.huge
        hum.Health = hum.MaxHealth
    end

    -- Infinite Stamina (поиск значений в Blood Engine)
    if State.InfiniteStamina then
        -- Ищем стамину в локальных скриптах
        local stamina = LocalPlayer:FindFirstChild('Stamina')
            or char:FindFirstChild('Stamina')

        if stamina then
            if stamina:IsA('NumberValue') then
                stamina.Value = math.huge
            elseif stamina:IsA('IntValue') then
                stamina.Value = 2147483647
            end
        end

        -- Поиск через getgc
        for _, obj in pairs(getgc(true)) do
            if type(obj) == 'table' then
                if rawget(obj, 'Stamina') then
                    obj.Stamina = math.huge
                end
                if rawget(obj, 'Fatigue') then
                    obj.Fatigue = 0
                end
            end
        end
    end

    -- No Recoil / No Spread / Fast Reload (Blood Engine weapon modules)
    if State.NoRecoil or State.NoSpread or State.FastReload or State.InstantAction then
        -- Поиск оружейных модулей
        for _, obj in pairs(getgc(true)) do
            if type(obj) == 'table' then
                -- No Recoil
                if State.NoRecoil then
                    if rawget(obj, 'Recoil') then obj.Recoil = 0 end
                    if rawget(obj, 'CameraRecoil') then obj.CameraRecoil = 0 end
                    if rawget(obj, 'Kick') then obj.Kick = 0 end
                end

                -- No Spread
                if State.NoSpread then
                    if rawget(obj, 'Spread') then obj.Spread = 0 end
                    if rawget(obj, 'MaxSpread') then obj.MaxSpread = 0 end
                    if rawget(obj, 'MinSpread') then obj.MinSpread = 0 end
                end

                -- Fast Reload
                if State.FastReload then
                    if rawget(obj, 'ReloadTime') then obj.ReloadTime = 0.1 end
                    if rawget(obj, 'ReloadSpeed') then obj.ReloadSpeed = 100 end
                end

                -- Instant Action
                if State.InstantAction then
                    if rawget(obj, 'ActionTime') then obj.ActionTime = 0 end
                    if rawget(obj, 'Cooldown') then obj.Cooldown = 0 end
                end
            end
        end
    end
end)

-- ============================================================
-- 12. ЗАЩИТА ОТ ПАДЕНИЯ
-- ============================================================

LocalPlayer.CharacterAdded:Connect(function(char)
    task.wait(1)
    -- Восстанавливаем состояние при респавне
    if State.WalkSpeed then
        local hum = char:FindFirstChildOfClass('Humanoid')
        if hum then hum.WalkSpeed = State.WalkSpeed end
    end
    if State.JumpPower then
        local hum = char:FindFirstChildOfClass('Humanoid')
        if hum then hum.JumpPower = State.JumpPower end
    end
    -- Пересоздаём ESP для локального игрока (не нужно, но для порядка)
end)

-- ============================================================
-- 13. УВЕДОМЛЕНИЕ О ЗАГРУЗКЕ
-- ============================================================

Library:Notify('Blood Engine Cheat загружен!', 5)