Pastebin

Paste #31274: No description

< previous paste - next paste>

Pasted by easy

Download View as text

local Config = {
    BoxesEnabled = true,
    NamesEnabled = false,
    TracersEnabled = false,
    EnemyColor = Color3.fromRGB(255, 0, 4),
    HitboxSize = Vector3.new(10, 10, 10),
    HitboxTransparency = 1,
    ShowNotifications = true
}

local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local StarterGui = game:GetService("StarterGui")

local Camera = workspace.CurrentCamera
local LocalPlayer = Players.LocalPlayer
local ESPFolder = Instance.new("Folder", game.CoreGui)
ESPFolder.Name = "CustomESP"

local function Notify(title, text, duration)
    StarterGui:SetCore("SendNotification", {
        Title = title,
        Text = text,
        Icon = "",
        Duration = duration or 3
    })
end

Notify("Frontlines ( Keyless )", "Loading...", 5)

local startTime = os.clock()

local function CreateBox(model)
    local box = Instance.new("BoxHandleAdornment")
    box.Name = "ESP_Box"
    box.Size = Vector3.new(4, 5, 1)
    box.Color3 = Config.EnemyColor
    box.Transparency = 0.7
    box.AlwaysOnTop = true
    box.Adornee = model:FindFirstChild("HumanoidRootPart")
    box.ZIndex = 10
    box.Parent = ESPFolder
    return box
end

local function CreateLabel(model)
    local billboardGui = Instance.new("BillboardGui")
    billboardGui.Name = "ESP_Label"
    billboardGui.Size = UDim2.new(0, 100, 0, 30)
    billboardGui.AlwaysOnTop = true
    billboardGui.StudsOffset = Vector3.new(0, 2, 0)
    billboardGui.Adornee = model:FindFirstChild("HumanoidRootPart")
    billboardGui.Parent = ESPFolder
    
    local nameLabel = Instance.new("TextLabel")
    nameLabel.Name = "NameLabel"
    nameLabel.Size = UDim2.new(1, 0, 1, 0)
    nameLabel.BackgroundTransparency = 1
    nameLabel.TextColor3 = Config.EnemyColor
    nameLabel.Text = "Enemy"
    nameLabel.TextScaled = true
    nameLabel.Font = Enum.Font.SourceSansBold
    nameLabel.Parent = billboardGui
    
    return billboardGui
end

local function CreateTracer(model)
    local line = Instance.new("LineHandleAdornment")
    line.Name = "ESP_Tracer"
    line.Color3 = Config.EnemyColor
    line.Transparency = 0.7
    line.AlwaysOnTop = true
    line.ZIndex = 10
    line.Adornee = workspace.Terrain
    line.Parent = ESPFolder
    
    return line
end

local TrackedEnemies = {}

local function UpdateESP()
    for model, espElements in pairs(TrackedEnemies) do
        if model and model:FindFirstChild("HumanoidRootPart") then
            local rootPart = model:FindFirstChild("HumanoidRootPart")
            
            if espElements.Box then
                espElements.Box.Adornee = rootPart
                espElements.Box.Visible = Config.BoxesEnabled
            end
            
            if espElements.Label then
                espElements.Label.Adornee = rootPart
                espElements.Label.Enabled = Config.NamesEnabled
            end
            
            if espElements.Tracer then
                espElements.Tracer.Visible = Config.TracersEnabled
                if Config.TracersEnabled then
                    espElements.Tracer.Adornee = workspace.Terrain
                    espElements.Tracer.Length = (rootPart.Position - Camera.CFrame.Position).Magnitude
                    espElements.Tracer.CFrame = CFrame.new(Camera.CFrame.Position, rootPart.Position) * CFrame.new(0, 0, -espElements.Tracer.Length/2)
                end
            end
        else

            if espElements.Box then espElements.Box:Destroy() end
            if espElements.Label then espElements.Label:Destroy() end
            if espElements.Tracer then espElements.Tracer:Destroy() end
            TrackedEnemies[model] = nil
        end
    end
end

local function IsEnemy(model)
    if model.Name == "soldier_model" and model:IsA("Model") and not model:FindFirstChild("friendly_marker") then
        return true
    end
    return false
end

local function ApplyHitbox(model)
    if not model:FindFirstChild("HumanoidRootPart") then return end
    
    local pos = model:FindFirstChild("HumanoidRootPart").Position
    for _, bp in pairs(workspace:GetChildren()) do
        if bp:IsA("BasePart") then
            local distance = (bp.Position - pos).Magnitude
            if distance <= 5 then
                bp.Transparency = Config.HitboxTransparency
                bp.Size = Config.HitboxSize
            end
        end
    end
end

local function AddESP(model)
    if not model:FindFirstChild("HumanoidRootPart") then 
        -- Wait for HumanoidRootPart to load
        task.spawn(function()
            local tries = 0
            while tries < 10 and not model:FindFirstChild("HumanoidRootPart") do
                tries = tries + 1
                task.wait(0.1)
            end
            if model:FindFirstChild("HumanoidRootPart") then
                AddESP(model)
            end
        end)
        return
    end
    
    local espElements = {}
    espElements.Box = CreateBox(model)
    espElements.Label = CreateLabel(model)
    espElements.Tracer = CreateTracer(model)
    
    TrackedEnemies[model] = espElements
    
    ApplyHitbox(model)
    
    if Config.ShowNotifications then
        Notify("ESP Script", "New enemy detected", 3)
    end
end

for _, model in pairs(workspace:GetDescendants()) do
    if IsEnemy(model) then
        AddESP(model)
    end
end

workspace.DescendantAdded:Connect(function(descendant)
    task.wait(0.5)  -- Small delay to ensure the model is fully loaded
    if IsEnemy(descendant) then
        AddESP(descendant)
    end
end)

workspace.DescendantRemoving:Connect(function(descendant)
    if TrackedEnemies[descendant] then
        local elements = TrackedEnemies[descendant]
        if elements.Box then elements.Box:Destroy() end
        if elements.Label then elements.Label:Destroy() end
        if elements.Tracer then elements.Tracer:Destroy() end
        TrackedEnemies[descendant] = nil
    end
end)

RunService:BindToRenderStep("UpdateESP", 1, UpdateESP)

local finishTime = os.clock()
local loadTime = finishTime - startTime
local loadRating = loadTime < 1 and "High End Device" or loadTime < 2 and "Medium End Device" or loadTime < 4 and "Low End Device" or "Low End Device"

Notify("ESP Script", string.format("Loaded In %.2f Seconds - %s", loadTime, loadRating), 5)

local function ToggleBoxes(enabled)
    Config.BoxesEnabled = enabled
end

local function ToggleNames(enabled)
    Config.NamesEnabled = enabled
end

local function ToggleTracers(enabled)
    Config.TracersEnabled = enabled
end

return {
    ToggleBoxes = ToggleBoxes,
    ToggleNames = ToggleNames,
    ToggleTracers = ToggleTracers,
    SetColor = function(color) Config.EnemyColor = color end,
    SetHitboxSize = function(size) Config.HitboxSize = size end,
    SetHitboxTransparency = function(trans) Config.HitboxTransparency = trans end,
    ToggleNotifications = function(enabled) Config.ShowNotifications = enabled end,
    CleanUp = function()
        RunService:UnbindFromRenderStep("UpdateESP")
        for model, elements in pairs(TrackedEnemies) do
            if elements.Box then elements.Box:Destroy() end
            if elements.Label then elements.Label:Destroy() end
            if elements.Tracer then elements.Tracer:Destroy() end
        end
        TrackedEnemies = {}
        ESPFolder:Destroy()
    end
}

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.