LuisBR4
Key Required

LuisBR4

Trench Warluisdaniel1030lkluisdaniel1030lk 697 views 474 executesUpdated Sep 20, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•458 lines (14914 chars)
--[[
    ╔══════════════════════════════════════════════════════════╗
    ║           TRENCH WAR TOOLKIT - v2.0                      ║
    ║       Script para Guerra de Trincheiras (Roblox)         ║
    ║                                                          ║
    ║  Funções:                                                ║
    ║  • ESP Inimigos (Team Check)                             ║
    ║  • Silent Aim                                            ║
    ║  • Aimbot com FOV Fixo (centro da tela)                  ║
    ║  • Aumento de Hitbox dos Inimigos                        ║
    ║  • Esconder Hitbox do Time                               ║
    ╚══════════════════════════════════════════════════════════╝
--]]

-- ============================================================
-- ==== CARREGAMENTO DA UI ====
-- ============================================================
local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()

-- ============================================================
-- ==== SERVIÇOS ====
-- ============================================================
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Camera = workspace.CurrentCamera
local LocalPlayer = Players.LocalPlayer

-- ============================================================
-- ==== CONFIGURAÇÕES ====
-- ============================================================
local Config = {
    ESP_Enabled = false,
    Aimbot_Enabled = false,
    SilentAim_Enabled = false,
    ShowFOV = true,
    AimPart = "Head",
    FOV = 150,
    Smoothness = 0.2,
    TeamCheck = true,
    Hitbox_Enabled = false,
    Hitbox_Size = 1.5,
    HideTeamHitbox = true
}

-- ============================================================
-- ==== CRIAÇÃO DA JANELA ====
-- ============================================================
local Window = Rayfield:CreateWindow({
    Name = "Trench War Toolkit",
    LoadingTitle = "Carregando Toolkit...",
    LoadingSubtitle = "v2.0",
    ConfigurationSaving = {Enabled = true, FolderName = "TrenchWarToolkit", FileName = "Config"},
    KeySystem = false
})

-- ============================================================
-- ==== ABA 1: PRINCIPAL ====
-- ============================================================
local MainTab = Window:CreateTab("Principal", 4483362458)

-- ==== SEÇÃO: ESP ====
MainTab:CreateSection("ESP - Inimigos")

MainTab:CreateToggle({
    Name = "Ativar ESP (Inimigos)",
    CurrentValue = false,
    Flag = "ESP_Toggle",
    Callback = function(Value)
        Config.ESP_Enabled = Value
        for _, v in ipairs(Players:GetPlayers()) do
            if v ~= LocalPlayer and v.Character then
                if Value then
                    AddESP(v.Character, v)
                else
                    RemoveESP(v.Character)
                end
            end
        end
    end,
})

-- ==== SEÇÃO: AIMBOT ====
MainTab:CreateSection("Aimbot - FOV Fixo")

MainTab:CreateToggle({
    Name = "Ativar Aimbot (FOV Fixo)",
    CurrentValue = false,
    Flag = "Aimbot_Toggle",
    Callback = function(Value)
        Config.Aimbot_Enabled = Value
        if FOV_Circle then
            FOV_Circle.Visible = Value and Config.ShowFOV
        end
    end,
})

MainTab:CreateToggle({
    Name = "Mostrar Círculo do FOV",
    CurrentValue = true,
    Flag = "ShowFOV_Toggle",
    Callback = function(Value)
        Config.ShowFOV = Value
        if FOV_Circle then
            FOV_Circle.Visible = Config.Aimbot_Enabled and Value
        end
    end,
})

MainTab:CreateDropdown({
    Name = "Parte do Corpo para Mirar",
    Options = {"Head", "Torso", "HumanoidRootPart", "UpperTorso"},
    CurrentOption = {"Head"},
    Flag = "AimPart_Dropdown",
    Callback = function(Option) Config.AimPart = Option[1] end,
})

MainTab:CreateSlider({
    Name = "Tamanho do Círculo (FOV)",
    Range = {50, 500},
    Increment = 10,
    Suffix = "px",
    CurrentValue = 150,
    Flag = "FOV_Slider",
    Callback = function(Value)
        Config.FOV = Value
        if FOV_Circle and FOV_Circle.Radius then
            FOV_Circle.Radius = Value
        end
    end,
})

MainTab:CreateSlider({
    Name = "Suavidade da Mira",
    Range = {0.05, 1},
    Increment = 0.05,
    Suffix = "",
    CurrentValue = 0.2,
    Flag = "Smooth_Slider",
    Callback = function(Value) Config.Smoothness = Value end,
})

-- ==== SEÇÃO: SILENT AIM ====
MainTab:CreateSection("Silent Aim")

MainTab:CreateToggle({
    Name = "Ativar Silent Aim",
    CurrentValue = false,
    Flag = "SilentAim_Toggle",
    Callback = function(Value)
        Config.SilentAim_Enabled = Value
        if Value then
            SilentAim_Loop()
        end
    end,
})

-- ============================================================
-- ==== ABA 2: HITBOX ====
-- ============================================================
local HitboxTab = Window:CreateTab("Hitbox", 4483362458)

HitboxTab:CreateSection("Hitbox Expandida - Inimigos")

HitboxTab:CreateToggle({
    Name = "Ativar Hitbox Expandida (Inimigos)",
    CurrentValue = false,
    Flag = "Hitbox_Toggle",
    Callback = function(Value)
        Config.Hitbox_Enabled = Value
        if Value then
            ApplyHitbox_Loop()
        else
            ResetHitbox()
        end
    end,
})

HitboxTab:CreateSlider({
    Name = "Tamanho da Hitbox",
    Range = {1, 5},
    Increment = 0.5,
    Suffix = "x",
    CurrentValue = 1.5,
    Flag = "Hitbox_Size_Slider",
    Callback = function(Value) Config.Hitbox_Size = Value end,
})

HitboxTab:CreateSection("Proteção do Time")

HitboxTab:CreateToggle({
    Name = "Esconder Hitbox do Time (Aliados)",
    CurrentValue = true,
    Flag = "HideTeam_Toggle",
    Callback = function(Value)
        Config.HideTeamHitbox = Value
        -- Restaura hitbox dos aliados se estiver ativado
        if Value and Config.Hitbox_Enabled then
            for _, p in ipairs(Players:GetPlayers()) do
                if p ~= LocalPlayer and p.Character and p.Team == LocalPlayer.Team then
                    ResetHitboxForCharacter(p.Character)
                end
            end
        end
    end,
})

-- ============================================================
-- ==== ABA 3: AJUSTES ====
-- ============================================================
local SettingsTab = Window:CreateTab("Ajustes", 4483362458)

SettingsTab:CreateToggle({
    Name = "Verificar Time (Team Check)",
    CurrentValue = true,
    Flag = "TeamCheck_Toggle",
    Callback = function(Value) Config.TeamCheck = Value end,
})

SettingsTab:CreateParagraph({
    Title = "Trench War Toolkit v2.0",
    Content = "Script para Guerra de Trincheiras. Todas as funções são locais (só você vê). Use em servidores privados."
})

SettingsTab:CreateButton({
    Name = "Destruir Interface",
    Callback = function() Rayfield:Destroy() end,
})

-- ============================================================
-- ==== CRIAÇÃO DO CÍRCULO DO FOV (FIXO NO CENTRO) ====
-- ============================================================
local FOV_Circle = nil
local ViewportSize = Camera.ViewportSize

pcall(function()
    FOV_Circle = Drawing.new("Circle")
    FOV_Circle.Thickness = 2
    FOV_Circle.NumSides = 60
    FOV_Circle.Radius = Config.FOV
    FOV_Circle.Filled = false
    FOV_Circle.Transparency = 1
    FOV_Circle.Color = Color3.fromRGB(0, 255, 0)
    FOV_Circle.Visible = false
    FOV_Circle.Position = Vector2.new(ViewportSize.X / 2, ViewportSize.Y / 2)
end)

-- ============================================================
-- ==== FUNÇÕES ====
-- ============================================================

-- Verifica se é inimigo (Team Check)
function IsEnemy(player)
    if player == LocalPlayer then return false end
    if Config.TeamCheck and player.Team and LocalPlayer.Team then
        return player.Team ~= LocalPlayer.Team
    end
    return true
end

-- ESP Inimigos
function AddESP(character, player)
    if not character or not character:FindFirstChild("Humanoid") then return end
    if character:FindFirstChild("EnemyHighlight") then return end
    if not IsEnemy(player) then return end

    local highlight = Instance.new("Highlight")
    highlight.Name = "EnemyHighlight"
    highlight.Adornee = character
    highlight.FillColor = Color3.fromRGB(255, 0, 0)
    highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
    highlight.FillTransparency = 0.5
    highlight.OutlineTransparency = 0
    highlight.Parent = character
end

function RemoveESP(character)
    if character then
        local hl = character:FindFirstChild("EnemyHighlight")
        if hl then hl:Destroy() end
    end
end

-- Alvo do Aimbot (baseado no CENTRO da tela)
function GetTarget()
    local target = nil
    local shortestDistance = Config.FOV
    local centerScreen = Vector2.new(ViewportSize.X / 2, ViewportSize.Y / 2)

    for _, player in ipairs(Players:GetPlayers()) do
        if player ~= LocalPlayer and player.Character then
            local character = player.Character
            if character:FindFirstChild("Humanoid") and character:FindFirstChild(Config.AimPart) then
                if character.Humanoid.Health > 0 and IsEnemy(player) then
                    local part = character[Config.AimPart]
                    local screenPos, onScreen = Camera:WorldToScreenPoint(part.Position)

                    if onScreen then
                        local dist = (Vector2.new(screenPos.X, screenPos.Y) - centerScreen).Magnitude
                        if dist < shortestDistance then
                            shortestDistance = dist
                            target = character
                        end
                    end
                end
            end
        end
    end
    return target
end

-- Silent Aim (mira silenciosa - trava a câmera no alvo sem mover o mouse visivelmente)
function SilentAim_Loop()
    task.spawn(function()
        while Config.SilentAim_Enabled do
            local target = GetTarget()
            if target and target:FindFirstChild(Config.AimPart) then
                local aimPart = target[Config.AimPart]
                -- Move a câmera suavemente para o alvo (silent aim)
                Camera.CFrame = CFrame.new(Camera.CFrame.Position, aimPart.Position)
            end
            task.wait(0.01)
        end
    end)
end

-- ============================================================
-- ==== FUNÇÕES DE HITBOX ====
-- ============================================================

-- Aplica hitbox expandida em UM personagem
function ApplyHitbox(character)
    if not character then return end
    for _, part in ipairs(character:GetDescendants()) do
        if part:IsA("BasePart") then
            if not part:GetAttribute("OriginalSize") then
                part:SetAttribute("OriginalSize", part.Size)
            end
            local original = part:GetAttribute("OriginalSize")
            if original then
                part.Size = Vector3.new(
                    original.X * Config.Hitbox_Size,
                    original.Y * Config.Hitbox_Size,
                    original.Z * Config.Hitbox_Size
                )
            end
        end
    end
end

-- Restaura hitbox de UM personagem
function ResetHitboxForCharacter(character)
    if not character then return end
    for _, part in ipairs(character:GetDescendants()) do
        if part:IsA("BasePart") then
            local original = part:GetAttribute("OriginalSize")
            if original then
                part.Size = original
                part:SetAttribute("OriginalSize", nil)
            end
        end
    end
end

-- Restaura hitbox de TODOS
function ResetHitbox()
    for _, player in ipairs(Players:GetPlayers()) do
        if player ~= LocalPlayer and player.Character then
            ResetHitboxForCharacter(player.Character)
        end
    end
end

-- Loop que aplica hitbox apenas em inimigos e restaura aliados
function ApplyHitbox_Loop()
    task.spawn(function()
        while Config.Hitbox_Enabled do
            for _, player in ipairs(Players:GetPlayers()) do
                if player ~= LocalPlayer and player.Character then
                    local char = player.Character
                    
                    if IsEnemy(player) then
                        -- Inimigo: aplica hitbox
                        ApplyHitbox(char)
                    else
                        -- Aliado: restaura hitbox (se HideTeamHitbox estiver ativo)
                        if Config.HideTeamHitbox then
                            ResetHitboxForCharacter(char)
                        end
                    end
                end
            end
            task.wait(1)
        end
    end)
end

-- ============================================================
-- ==== LOOP PRINCIPAL ====
-- ============================================================
RunService.RenderStepped:Connect(function()
    -- Atualiza o círculo do FOV (fixo no centro)
    if FOV_Circle then
        if FOV_Circle.Position then
            local newSize = Camera.ViewportSize
            FOV_Circle.Position = Vector2.new(newSize.X / 2, newSize.Y / 2)
            FOV_Circle.Radius = Config.FOV
            FOV_Circle.Visible = Config.Aimbot_Enabled and Config.ShowFOV
        end
    end

    -- Aimbot: trava sozinho quando o inimigo entra no círculo
    if Config.Aimbot_Enabled then
        local target = GetTarget()
        if target then
            local aimPart = target[Config.AimPart]
            Camera.CFrame = Camera.CFrame:Lerp(CFrame.new(Camera.CFrame.Position, aimPart.Position), Config.Smoothness)
        end
    end

    -- Atualiza ESP de novos personagens automaticamente
    if Config.ESP_Enabled then
        for _, player in ipairs(Players:GetPlayers()) do
            if player ~= LocalPlayer and player.Character then
                local char = player.Character
                if char:FindFirstChild("Humanoid") and not char:FindFirstChild("EnemyHighlight") and IsEnemy(player) then
                    AddESP(char, player)
                end
            end
        end
    end
end)

-- ============================================================
-- ==== INICIALIZAÇÃO ====
-- ============================================================
for _, v in ipairs(Players:GetPlayers()) do
    if v ~= LocalPlayer and v.Character then
        AddESP(v.Character, v)
    end
end

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        task.wait(1)
        AddESP(character, player)
        if Config.Hitbox_Enabled and IsEnemy(player) then
            ApplyHitbox(character)
        end
    end)
end)

Rayfield:Notify({
    Title = "Trench War Toolkit v2.0",
    Content = "Script carregado! Todas as funções ativas.",
    Duration = 5,
    Image = 4483362458
})

Features & Information

Meu

Community Comments (0)

No comments yet for this script.

More Scripts for Trench War