Advanced ESP New Features
Key RequiredUniversal

Advanced ESP New Features

Universal Scriptsarcophilesarcophile 622 views 739 executesUpdated Jan 17, 2026
Unrated
00
Lua Script•226 lines (8481 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local StarterGui = game:GetService("StarterGui")
local UserInputService = game:GetService("UserInputService")
local CoreGui = game:GetService("CoreGui")

local CONFIG = {
    ESP_ENABLED = true,
    BEHIND_DETECTION_ENABLED = true,
    DETECTION_DISTANCE = 35, 
    DETECTION_SENSITIVITY = 0.6, 
    COOLDOWN_TIME = 3,
    OBSCURRED_COLOR = Color3.fromRGB(0, 100, 255),
    VISIBLE_COLOR = Color3.fromRGB(255, 40, 40),
    WHITELIST_COLOR = Color3.fromRGB(0, 255, 0),
    TEXT_COLOR = Color3.fromRGB(255, 255, 255)
}

local localPlayer = Players.LocalPlayer
local camera = Workspace.CurrentCamera
local mouse = localPlayer:GetMouse()
local whitelistedPlayers = {}
local SAVE_FILE = "TacticalScript_HideMenu.txt"

local screenGui = Instance.new("ScreenGui")
screenGui.Name = "DetectionAlerts"
screenGui.Parent = CoreGui

local alertLabel = Instance.new("TextLabel")
alertLabel.Size = UDim2.new(0, 800, 0, 100)
alertLabel.Position = UDim2.new(0.5, -400, 0.05, 0)
alertLabel.BackgroundTransparency = 1
alertLabel.TextColor3 = Color3.fromRGB(255, 50, 50)
alertLabel.TextStrokeTransparency = 0
alertLabel.Font = Enum.Font.GothamBold
alertLabel.TextSize = 22
alertLabel.TextWrapped = true
alertLabel.Text = ""
alertLabel.Parent = screenGui

local function shouldShowMenu()
    if isfile and isfile(SAVE_FILE) then return false end
    return true
end

local function createMenu()
    if not shouldShowMenu() then return end
    local menuGui = Instance.new("ScreenGui")
    menuGui.Name = "TacticalInstructions"
    menuGui.Parent = CoreGui

    local frame = Instance.new("Frame")
    frame.Size = UDim2.new(0, 400, 0, 240)
    frame.Position = UDim2.new(0.5, -200, 0.5, -120)
    frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
    frame.Active = true
    frame.Draggable = true
    frame.Parent = menuGui

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

    local text = Instance.new("TextLabel")
    text.Size = UDim2.new(1, -30, 1, -70)
    text.Position = UDim2.new(0, 15, 0, 15)
    text.BackgroundTransparency = 1
    text.TextColor3 = Color3.fromRGB(230, 230, 230)
    text.TextSize = 16
    text.Font = Enum.Font.Gotham
    text.TextXAlignment = Enum.TextXAlignment.Left
    text.TextWrapped = true
    text.Text = "1. Press F on player to Whitelist.\n2. CTRL + Y to toggle Detection.\n3. CTRL + G to toggle ESP."
    text.Parent = frame

    local btn = Instance.new("TextButton")
    btn.Size = UDim2.new(0, 120, 0, 40)
    btn.Position = UDim2.new(0.5, -60, 1, -55)
    btn.Text = "OK"
    btn.Parent = frame

    btn.MouseButton1Click:Connect(function()
        if writefile then writefile(SAVE_FILE, "true") end
        menuGui:Destroy()
    end)
end

UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    local ctrl = UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) or UserInputService:IsKeyDown(Enum.KeyCode.RightControl)

    if input.KeyCode == Enum.KeyCode.F then
        local target = mouse.Target
        if target then
            local char = target:FindFirstAncestorOfClass("Model")
            local player = Players:GetPlayerFromCharacter(char)
            if player and player ~= localPlayer then
                if whitelistedPlayers[player.UserId] then
                    whitelistedPlayers[player.UserId] = nil
                    StarterGui:SetCore("SendNotification", {Title = "System", Text = "Removed " .. player.DisplayName, Duration = 2})
                else
                    whitelistedPlayers[player.UserId] = true
                    StarterGui:SetCore("SendNotification", {Title = "System", Text = "Whitelisted " .. player.DisplayName, Duration = 2})
                end
            end
        end
    end

    if ctrl and input.KeyCode == Enum.KeyCode.G then
        CONFIG.ESP_ENABLED = not CONFIG.ESP_ENABLED
        StarterGui:SetCore("SendNotification", {Title = "ESP Toggle", Text = "ESP is now " .. (CONFIG.ESP_ENABLED and "ON" or "OFF"), Duration = 2})
    end

    if ctrl and input.KeyCode == Enum.KeyCode.Y then
        CONFIG.BEHIND_DETECTION_ENABLED = not CONFIG.BEHIND_DETECTION_ENABLED
        StarterGui:SetCore("SendNotification", {Title = "Detection Toggle", Text = "Detection is now " .. (CONFIG.BEHIND_DETECTION_ENABLED and "ON" or "OFF"), Duration = 2})
    end
end)

local function setupESP(character, player)
    local highlight = character:FindFirstChild("TacticalHighlight")
    if not highlight then
        highlight = Instance.new("Highlight")
        highlight.Name = "TacticalHighlight"
        highlight.FillTransparency = 1
        highlight.OutlineTransparency = 0
        highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
        highlight.Parent = character
    end

    local head = character:FindFirstChild("Head")
    local espGui = character:FindFirstChild("TacticalInfo")
    
    if head and not espGui then
        espGui = Instance.new("BillboardGui")
        espGui.Name = "TacticalInfo"
        espGui.Size = UDim2.new(0, 200, 0, 50)
        espGui.StudsOffset = Vector3.new(0, 3.5, 0)
        espGui.AlwaysOnTop = true
        espGui.Adornee = head
        espGui.Parent = character

        local nL = Instance.new("TextLabel", espGui)
        nL.BackgroundTransparency = 1
        nL.Size = UDim2.new(1, 0, 1, 0)
        nL.TextColor3 = CONFIG.TEXT_COLOR
        nL.Font = Enum.Font.GothamBold
        nL.TextSize = 14
        nL.Text = player.DisplayName
    end
    return highlight, espGui
end

local function checkLineOfSight(targetCharacter)
    if not localPlayer.Character then return false end
    local head = targetCharacter:FindFirstChild("Head")
    if not head then return false end
    local params = RaycastParams.new()
    params.FilterDescendantsInstances = {localPlayer.Character, targetCharacter}
    params.FilterType = Enum.RaycastFilterType.Exclude
    local result = Workspace:Raycast(camera.CFrame.Position, head.Position - camera.CFrame.Position, params)
    return result == nil
end

RunService.RenderStepped:Connect(function()
    local myRoot = localPlayer.Character and localPlayer.Character:FindFirstChild("HumanoidRootPart")
    
    local behindAbove = 0
    local behindBelow = 0
    local behindLevel = 0

    for _, player in ipairs(Players:GetPlayers()) do
        if player ~= localPlayer and player.Character then
            local char = player.Character
            local root = char:FindFirstChild("HumanoidRootPart")
            local highlight, espGui = setupESP(char, player)
            local isWhitelisted = whitelistedPlayers[player.UserId]

            if highlight then highlight.Enabled = CONFIG.ESP_ENABLED end
            if espGui then espGui.Enabled = CONFIG.ESP_ENABLED end

            if CONFIG.ESP_ENABLED and highlight then
                if isWhitelisted then
                    highlight.OutlineColor = CONFIG.WHITELIST_COLOR
                else
                    highlight.OutlineColor = checkLineOfSight(char) and CONFIG.VISIBLE_COLOR or CONFIG.OBSCURRED_COLOR
                end
            end

            if CONFIG.BEHIND_DETECTION_ENABLED and not isWhitelisted and myRoot and root then
                local dist = (myRoot.Position - root.Position).Magnitude
                local rel = myRoot.CFrame:PointToObjectSpace(root.Position)

                if dist <= CONFIG.DETECTION_DISTANCE and rel.Z > 0 and rel.Z > math.abs(rel.X) * CONFIG.DETECTION_SENSITIVITY then
                    if rel.Y > 6 then
                        behindAbove = behindAbove + 1
                    elseif rel.Y < -6 then
                        behindBelow = behindBelow + 1
                    else
                        behindLevel = behindLevel + 1
                    end
                end
            end
        end
    end

    local messages = {}
    if behindAbove > 0 then
        table.insert(messages, string.format("[%d] BEHIND ABOVE", behindAbove))
    end
    if behindLevel > 0 then
        table.insert(messages, string.format("[%d] BEHIND YOU", behindLevel))
    end
    if behindBelow > 0 then
        table.insert(messages, string.format("[%d] BEHIND BELOW", behindBelow))
    end

    if #messages > 0 then
        alertLabel.Text = "⚠️ " .. table.concat(messages, " | ")
    else
        alertLabel.Text = ""
    end
end)

createMenu()

Features & Information

This script is an advanced esp script, this script will alert you if a player is behind you, you can edit the distance for them to appear easily in the script. This also tells you if you are below you, or above you. This can be toggled with a keybind and so can all the other features. (keybinds are listed when script is executed. When a player is in view, their highlight will turn red, as to make sure you do not shoot someone who is out of sight to not arouse suspicion. Another keybind can whitelist players, this will turn their highlight green and not allow enemy detection to detect them.

Community Comments (1)

00Fazee00FazeeJan 17, 2026

chatgpt

More Scripts for Universal Scripts