script esp works only on enemies
Key RequiredUniversal

script esp works only on enemies

Universal Scriptinf6inf6 1.2K views 661 executesUpdated Feb 12, 2026
Unrated
00
Lua Script•143 lines (5250 chars)
-- [[ إعدادات الألوان الفاخرة ]] --
local UIColors = {
    Main = Color3.fromRGB(15, 15, 15),
    Accent = Color3.fromRGB(0, 255, 180),
    Text = Color3.fromRGB(255, 255, 255),
    Enemy = Color3.fromRGB(255, 50, 50)
}

-- [[ إنشاء الشاشة ]] --
local ScreenGui = Instance.new("ScreenGui", game.CoreGui)
ScreenGui.Name = "EnemyEspInf6"

-- [[ الإطار الرئيسي ]] --
local MainFrame = Instance.new("Frame", ScreenGui)
MainFrame.Size = UDim2.new(0, 220, 0, 160) -- قمت بتوسيع العرض قليلاً ليناسب الاسم الجديد
MainFrame.Position = UDim2.new(0.05, 0, 0.4, 0)
MainFrame.BackgroundColor3 = UIColors.Main
MainFrame.Active = true
MainFrame.Draggable = true
MainFrame.ClipsDescendants = true

local Corner = Instance.new("UICorner", MainFrame)
Corner.CornerRadius = UDim.new(0, 15)
local Stroke = Instance.new("UIStroke", MainFrame)
Stroke.Color = UIColors.Accent
Stroke.Thickness = 2
Stroke.Transparency = 0.5

-- زر الإغلاق (Minimize)
local CloseBtn = Instance.new("TextButton", MainFrame)
CloseBtn.Size = UDim2.new(0, 25, 0, 25)
CloseBtn.Position = UDim2.new(0.85, 0, 0.05, 0)
CloseBtn.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
CloseBtn.Text = "×"
CloseBtn.TextColor3 = UIColors.Accent
CloseBtn.Font = Enum.Font.GothamBold
CloseBtn.TextSize = 18
Instance.new("UICorner", CloseBtn).CornerRadius = UDim.new(1, 0)

-- زر الفتح العائم (Floating Icon)
local OpenBtn = Instance.new("TextButton", ScreenGui)
OpenBtn.Size = UDim2.new(0, 50, 0, 50)
OpenBtn.Position = UDim2.new(0.05, 0, 0.4, 0)
OpenBtn.BackgroundColor3 = UIColors.Main
OpenBtn.Text = "INF 6"
OpenBtn.TextColor3 = UIColors.Accent
OpenBtn.Font = Enum.Font.GothamBold
OpenBtn.TextSize = 12
OpenBtn.Visible = false
OpenBtn.Draggable = true
Instance.new("UICorner", OpenBtn).CornerRadius = UDim.new(1, 0)
local OpenStroke = Instance.new("UIStroke", OpenBtn)
OpenStroke.Color = UIColors.Accent
OpenStroke.Thickness = 2

-- عنوان القائمة الجديد
local Title = Instance.new("TextLabel", MainFrame)
Title.Size = UDim2.new(1, 0, 0, 45)
Title.Text = "ENEMY ESP INF 6"
Title.TextColor3 = UIColors.Accent
Title.Font = Enum.Font.GothamBold
Title.TextSize = 16
Title.BackgroundTransparency = 1

-- زر تفعيل الكشف
local ToggleBase = Instance.new("TextButton", MainFrame)
ToggleBase.Size = UDim2.new(0, 180, 0, 45)
ToggleBase.Position = UDim2.new(0.1, 0, 0.5, 0)
ToggleBase.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
ToggleBase.Text = "TRACKING: OFF"
ToggleBase.TextColor3 = UIColors.Text
ToggleBase.Font = Enum.Font.GothamBold
Instance.new("UICorner", ToggleBase)

-- [[ منطق التتبع ]] --
local IsEnabled = false

local function runESP()
    local lp = game.Players.LocalPlayer
    local char = lp.Character
    if not char or not char:FindFirstChild("Head") then return end

    for _, p in ipairs(game.Players:GetPlayers()) do
        if p ~= lp and p.Character and p.Character:FindFirstChild("Head") then
            local head = p.Character.Head
            local hum = p.Character:FindFirstChild("Humanoid")
            
            -- فحص الأعداء
            local isEnemy = (not p.Team or not lp.Team) or (p.Team ~= lp.Team)
            
            if IsEnabled and isEnemy and hum then
                if not head:FindFirstChild("ProESP") then
                    local bg = Instance.new("BillboardGui", head)
                    bg.Name = "ProESP"
                    bg.Size = UDim2.new(3,0,1,0)
                    bg.AlwaysOnTop = true
                    bg.ExtentsOffset = Vector3.new(0, 2.5, 0)
                    local txt = Instance.new("TextLabel", bg)
                    txt.Size = UDim2.new(1,0,1,0)
                    txt.BackgroundTransparency = 1
                    txt.Font = Enum.Font.GothamBold
                    txt.TextSize = 13
                    txt.TextStrokeTransparency = 0.5
                end
                local dist = math.floor((char.Head.Position - head.Position).Magnitude)
                head.ProESP.TextLabel.Text = math.floor(hum.Health) .. " HP | " .. dist .. "m"
                head.ProESP.TextLabel.TextColor3 = Color3.fromHSV(math.clamp(hum.Health/100, 0, 0.35), 0.8, 1)
                head.ProESP.Enabled = true
            else
                if head:FindFirstChild("ProESP") then head.ProESP.Enabled = false end
            end
        end
    end
end

-- [[ أنيميشن الإغلاق والفتح ]] --
CloseBtn.MouseButton1Click:Connect(function()
    MainFrame:TweenSize(UDim2.new(0, 0, 0, 0), "In", "Back", 0.3, true, function()
        MainFrame.Visible = false
        OpenBtn.Visible = true
        OpenBtn.Position = MainFrame.Position
    end)
end)

OpenBtn.MouseButton1Click:Connect(function()
    OpenBtn.Visible = false
    MainFrame.Visible = true
    MainFrame:TweenSize(UDim2.new(0, 220, 0, 160), "Out", "Back", 0.3, true)
end)

-- تفاعل زر التتبع
ToggleBase.MouseButton1Click:Connect(function()
    IsEnabled = not IsEnabled
    ToggleBase.Text = IsEnabled and "TRACKING: ON" or "TRACKING: OFF"
    ToggleBase.TextColor3 = IsEnabled and UIColors.Accent or UIColors.Text
    
    -- تأثير نبض عند الضغط
    ToggleBase:TweenSize(UDim2.new(0, 175, 0, 42), "Out", "Quad", 0.1, true, function()
        ToggleBase:TweenSize(UDim2.new(0, 180, 0, 45), "Out", "Quad", 0.1, true)
    end)
end)

game:GetService("RunService").RenderStepped:Connect(runESP)

Features & Information

it's very cool It won't bother you because it will only work on the enemies and leave your team 😉👍

Community Comments (1)

inf6inf6Feb 12, 2026

have fun • If you encounter any problem please contact me

More Scripts for Universal Scripts