0% found this document useful (0 votes)
131 views2 pages

Deadline FREE ESP NOV 2024

The document contains a Lua script for creating a 2D ESP (Extra Sensory Perception) overlay in a game environment. It defines functions to create, update, and clean up visual boxes around character models based on their positions in the game world. The script also includes event listeners for adding and removing characters, as well as a keybind to clear the ESP overlay.

Uploaded by

smescravo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views2 pages

Deadline FREE ESP NOV 2024

The document contains a Lua script for creating a 2D ESP (Extra Sensory Perception) overlay in a game environment. It defines functions to create, update, and clean up visual boxes around character models based on their positions in the game world. The script also includes event listeners for adding and removing characters, as well as a keybind to clear the ESP overlay.

Uploaded by

smescravo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

local ESP = {}

local camera = workspace.CurrentCamera


local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local WorldToViewportPoint = camera.WorldToViewportPoint

local function Create2DESP(model)


if not model or not model.Parent then return end

if ESP[model] then return end

local drawings = {
box = Drawing.new("Square")
}

local box = drawings.box


box.Thickness = 1
box.Color = Color3.fromRGB(255, 255, 255)
box.Transparency = 1
box.Filled = false
box.Visible = false

ESP[model] = drawings
end

local updateConnection = RunService.PreRender:Connect(function()


for model, drawings in pairs(ESP) do
local rootPart = model:FindFirstChild("humanoid_root_part")
if not rootPart then
drawings.box.Visible = false
continue
end

local rootCFrame = rootPart.CFrame


local rootPos = rootCFrame.Position
local upVectorY = rootCFrame.UpVector.Y
local screenPos, onScreen = WorldToViewportPoint(camera, rootPos)

if onScreen then
local offset = Vector3.new(0, 3 * math.abs(upVectorY), 0)
local topPos = WorldToViewportPoint(camera, rootPos + offset)
local bottomPos = WorldToViewportPoint(camera, rootPos - offset)

local height = math.abs(topPos.Y - bottomPos.Y)


local width = height * 0.6

drawings.box.Size = Vector2.new(width, height)


drawings.box.Position = Vector2.new(screenPos.X - width/2, screenPos.Y
- height/2)
drawings.box.Visible = true
else
drawings.box.Visible = false
end
end
end)

local characters = workspace:WaitForChild("characters")


if characters then
for _, model in ipairs(characters:GetChildren()) do
task.spawn(function()
Create2DESP(model)
end)
end

characterAddedConnection = characters.ChildAdded:Connect(function(model)
task.wait(0.5)
task.spawn(function()
Create2DESP(model)
end)
end)

characterRemovedConnection = characters.ChildRemoved:Connect(function(model)
if ESP[model] then
ESP[model].box:Remove()
ESP[model] = nil
end
end)
end

local function CleanupESP()


for _, drawings in pairs(ESP) do
drawings.box:Remove()
end
ESP = {}

if updateConnection then
updateConnection:Disconnect()
end
if characterAddedConnection then
characterAddedConnection:Disconnect()
end
if characterRemovedConnection then
characterRemovedConnection:Disconnect()
end
end

game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.RightControl then
CleanupESP()
end
end)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy