Permanent esp script
Key RequiredUniversal

Permanent esp script

Universal ScriptZk_zakyZk_zaky 2.3K views 18 executesUpdated Jul 13, 2025
Unrated
00
Lua Script•106 lines (3274 chars)
-- ESP Outline Script for Roblox Studio
-- Compatible with Mobile and PC
-- Features:
-- 1. Outline around players
-- 2. Remains active when player dies
-- 3. Automatically works for new joining players

-- Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

-- Configuration
local ESP_COLOR = Color3.fromRGB(0, 255, 0) -- Green for outline
local ESP_THICKNESS = 2 -- Outline thickness
local ESP_TRANSPARENCY = 0.7 -- Outline transparency
local ESP_REFRESH_RATE = 0.1 -- Update every 0.1 seconds

-- Variables
local espCache = {}
local connections = {}

-- Function to create ESP
local function createESP(player)
    local character = player.Character or player.CharacterAdded:Wait()
    
    -- Create highlight for outline
    local highlight = Instance.new("Highlight")
    highlight.Name = player.Name .. "_ESP"
    highlight.OutlineColor = ESP_COLOR
    highlight.OutlineTransparency = ESP_TRANSPARENCY
    highlight.FillTransparency = 1 -- Transparent fill
    highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
    highlight.Adornee = character
    highlight.Parent = character
    
    -- Save to cache
    espCache[player.Name] = highlight
    
    -- Handle character death
    character:WaitForChild("Humanoid").Died:Connect(function()
        -- Change outline color to red when dead
        highlight.OutlineColor = Color3.fromRGB(255, 0, 0)
        
        -- Keep outline visible even when dead
        if character:FindFirstChild("HumanoidRootPart") then
            highlight.Adornee = character
        end
    end)
end

-- Function to initialize ESP
local function initESP()
    -- Clear old cache and connections
    for _, highlight in pairs(espCache) do
        highlight:Destroy()
    end
    espCache = {}
    
    for _, connection in pairs(connections) do
        connection:Disconnect()
    end
    connections = {}
    
    -- Create ESP for existing players
    for _, player in ipairs(Players:GetPlayers()) do
        if player ~= Players.LocalPlayer then
            coroutine.wrap(function()
                createESP(player)
            end)()
        end
    end
    
    -- Handle new joining players
    table.insert(connections, Players.PlayerAdded:Connect(function(player)
        coroutine.wrap(function()
            createESP(player)
        end)()
    end))
    
    -- Handle leaving players
    table.insert(connections, Players.PlayerRemoving:Connect(function(player)
        if espCache[player.Name] then
            espCache[player.Name]:Destroy()
            espCache[player.Name] = nil
        end
    end))
    
    -- Handle character respawn
    table.insert(connections, Players.PlayerCharacterSet:Connect(function(player)
        if player ~= Players.LocalPlayer and espCache[player.Name] then
            -- Wait a moment to ensure character exists
            wait(1)
            if player.Character then
                espCache[player.Name].Adornee = player.Character
                -- Reset color to normal after respawn
                espCache[player.Name].OutlineColor = ESP_COLOR
            end
        end
    end))
end

-- Start ESP after everything is ready
RunService.Heartbeat:Wait()
initESP()

print("ESP Outline Script successfully activated!")

Features & Information

Roblox esp script by blackbox ai

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts