--Settings--
local ESP = {
Enabled = true,
Boxes = true,
BoxShift = [Link](0,-1.5,0),
BoxSize = [Link](4,6,0),
Color = [Link](255, 255, 255),
FaceCamera = false,
Names = false,
Distance = false,
TeamColor = true,
Thickness = 2,
AttachShift = 1,
TeamMates = true,
Players = false,
Health = true,
HealthOffsetX = 7,
HealthOffsetY = -2.9,
Items = false,
ItemOffset = 19,
Objects = setmetatable({}, {__mode="kv"}),
Overrides = {}
}
--Declarations--
local cam = [Link]
local plrs = game:GetService("Players")
local plr = [Link]
local mouse = plr:GetMouse()
local V3new = [Link]
local WorldToViewportPoint = [Link]
--Functions--
local function Draw(obj, props)
local new = [Link](obj)
props = props or {}
for i,v in pairs(props) do
new[i] = v
end
return new
end
function ESP:GetTeam(p)
local ov = [Link]
if ov then
return ov(p)
end
return p and [Link]
end
function ESP:IsTeamMate(p)
local ov = [Link]
if ov then
return ov(p)
end
return self:GetTeam(p) == self:GetTeam(plr)
end
function ESP:GetColor(obj)
local ov = [Link]
if ov then
return ov(obj)
end
local p = self:GetPlrFromChar(obj)
return p and [Link] and [Link] and [Link] or
[Link]
end
function ESP:GetPlrFromChar(char)
local ov = [Link]
if ov then
return ov(char)
end
return plrs:GetPlayerFromCharacter(char)
end
function ESP:Toggle(bool)
[Link] = bool
for obj, box in pairs([Link]) do
if [Link] == "Box" then
if bool then
-- Show the ESP box
for _, component in pairs([Link]) do
[Link] = true
end
else
-- Hide the ESP box
for _, component in pairs([Link]) do
if [Link] then
[Link] = false
end
end
end
end
end
end
function ESP:GetBox(obj)
return [Link][obj]
end
function ESP:AddObjectListener(parent, options)
local function NewListener(c)
if type([Link]) == "string" and c:IsA([Link]) or [Link]
== nil then
if type([Link]) == "string" and [Link] == [Link] or
[Link] == nil then
if not [Link] or [Link](c) then
local box = ESP:Add(c, {
PrimaryPart = type([Link]) == "string" and
c:WaitForChild([Link]) or type([Link]) == "function" and
[Link](c),
Color = type([Link]) == "function" and
[Link](c) or [Link],
ColorDynamic = [Link],
Name = type([Link]) == "function" and
[Link](c) or [Link],
IsEnabled = [Link],
RenderInNil = [Link]
})
--TODO: add a better way of passing options
if [Link] then
[Link]([Link])(box)
end
end
end
end
end
if [Link] then
[Link]:Connect(NewListener)
for i,v in pairs(parent:GetDescendants()) do
[Link](NewListener)(v)
end
else
[Link]:Connect(NewListener)
for i,v in pairs(parent:GetChildren()) do
[Link](NewListener)(v)
end
end
end
local boxBase = {}
boxBase.__index = boxBase
function boxBase:Remove()
[Link][[Link]] = nil
for i,v in pairs([Link]) do
[Link] = false
v:Remove()
[Link][i] = nil
end
end
function boxBase:Update()
if not [Link] then
--warn("not supposed to print", [Link])
return self:Remove()
end
local color
if [Link] == [Link] then
color = [Link]
else
color = [Link] or [Link] and self:ColorDynamic() or
ESP:GetColor([Link]) or [Link]
end
local allow = true
if [Link] and not [Link](self) then
allow = false
end
if [Link] and not [Link] and ESP:IsTeamMate([Link]) then
allow = false
end
if [Link] and not [Link] then
allow = false
end
if [Link] and (type([Link]) == "string" and not
ESP[[Link]] or type([Link]) == "function" and not self:IsEnabled())
then
allow = false
end
if not workspace:IsAncestorOf([Link]) and not [Link] then
allow = false
end
if not allow then
for i,v in pairs([Link]) do
[Link] = false
end
return
end
if [Link] == [Link] then
color = [Link]
end
--calculations--
local cf = [Link]
if [Link] then
cf = [Link](cf.p, [Link].p)
end
local size = [Link]
local locs = {
TopLeft = cf * [Link] * [Link](size.X/2,size.Y/2,0),
TopRight = cf * [Link] * [Link](-size.X/2,size.Y/2,0),
BottomLeft = cf * [Link] * [Link](size.X/2,-size.Y/2,0),
BottomRight = cf * [Link] * [Link](-size.X/2,-size.Y/2,0),
TagPos = cf * [Link] * [Link](0,size.Y/2,0),
Torso = cf * [Link]
}
if [Link] then
local TopLeft, Vis1 = WorldToViewportPoint(cam, [Link].p)
local TopRight, Vis2 = WorldToViewportPoint(cam, [Link].p)
local BottomLeft, Vis3 = WorldToViewportPoint(cam, [Link].p)
local BottomRight, Vis4 = WorldToViewportPoint(cam, [Link].p)
if [Link] then
if Vis1 or Vis2 or Vis3 or Vis4 then
[Link] = true
[Link] = [Link](TopRight.X, TopRight.Y)
[Link] = [Link](TopLeft.X, TopLeft.Y)
[Link] = [Link](BottomLeft.X,
BottomLeft.Y)
[Link] = [Link](BottomRight.X,
BottomRight.Y)
[Link] = color
else
[Link] = false
end
end
else
[Link] = false
end
if [Link] then
local TagPos, Vis5 = WorldToViewportPoint(cam, [Link].p)
if Vis5 then
[Link] = true
[Link] = [Link](TagPos.X, TagPos.Y)
[Link] = [Link]
[Link] = color
else
[Link] = false
end
else
[Link] = false
end
if [Link] then
local TagPos, Vis5 = WorldToViewportPoint(cam, [Link].p)
if Vis5 then
[Link] = true
[Link] = [Link](TagPos.X, TagPos.Y +
14)
[Link] = [Link](([Link].p -
cf.p).magnitude) .."m"
[Link] = color
else
[Link] = false
end
else
[Link] = false
end
if [Link] then
local TorsoPos, Vis6 = WorldToViewportPoint(cam, [Link].p)
if Vis6 then
[Link] = true
[Link] = [Link](TorsoPos.X, TorsoPos.Y)
[Link] =
[Link]([Link].X/2,[Link].Y/[Link])
[Link] = color
else
[Link] = false
end
else
[Link] = false
end
if [Link] and [Link] and [Link]:FindFirstChild'Head' and
[Link]:FindFirstChild'Torso' then
local HeadPos, Vis7 = WorldToViewportPoint(cam, [Link])
local TorsoPos, Vis8 = WorldToViewportPoint(cam,
[Link])
if Vis7 or Vis8 then
local s = [Link](([Link](HeadPos.X, HeadPos.Y) -
[Link](TorsoPos.X, TorsoPos.Y)).magnitude, 2, [Link])
local b = ([Link](TorsoPos.X - s, TorsoPos.Y - s*2) -
[Link](TorsoPos.X - s, TorsoPos.Y + s*2)).magnitude
local offset =
[Link]/[Link] * b
local hOffsetX = [Link]
local hOffsetY = [Link]
[Link] = true
[Link] = true
[Link] = [Link](TorsoPos.X - s - hOffsetX,
TorsoPos.Y - s*hOffsetY)
[Link] = [Link](TorsoPos.X - s - hOffsetX,
TorsoPos.Y - s*hOffsetY - offset)
[Link] = [Link](TorsoPos.X - s - hOffsetX,
TorsoPos.Y - s*hOffsetY);
[Link] = [Link](TorsoPos.X - s - hOffsetX,
TorsoPos.Y - s*hOffsetY);
local g = [Link](0, 255, 8)
local r = [Link](255, 0, 0)
[Link] = r:lerp(g, [Link] /
[Link])
else
[Link] = false
[Link] = false
end
else
[Link] = false
[Link] = false
end
if [Link] and [Link] and [Link]:FindFirstChildWhichIsA'Tool' and
[Link]:FindFirstChild'Torso' then
local TorsoPos, Vis9 = WorldToViewportPoint(cam,
[Link])
if Vis9 then
local ItemOffset = [Link]
[Link] =
tostring([Link]:FindFirstChildWhichIsA'Tool'.Name)
[Link] = [Link](TorsoPos.X, TorsoPos.Y +
ItemOffset)
[Link] = true
[Link] = color
else
[Link] = false
end
else
[Link] = false
end
end
function ESP:Add(obj, options)
if not [Link] and not [Link] then
return warn(obj, "has no parent")
end
local box = setmetatable({
Name = [Link] or [Link],
Type = "Box",
Color = [Link] --[[or self:GetColor(obj)]],
Size = [Link] or [Link],
Object = obj,
Player = [Link] or plrs:GetPlayerFromCharacter(obj),
PrimaryPart = [Link] or [Link] == "Model" and
([Link] or obj:FindFirstChild("HumanoidRootPart") or
obj:FindFirstChildWhichIsA("BasePart")) or obj:IsA("BasePart") and obj,
Components = {},
IsEnabled = [Link],
Temporary = [Link],
ColorDynamic = [Link],
RenderInNil = [Link]
}, boxBase)
if self:GetBox(obj) then
self:GetBox(obj):Remove()
end
[Link]["Quad"] = Draw("Quad", {
Thickness = [Link],
Color = color,
Transparency = 1,
Filled = false,
Visible = [Link] and [Link]
})
[Link]["Name"] = Draw("Text", {
Text = [Link],
Color = [Link],
Center = true,
Outline = true,
Size = 19,
Visible = [Link] and [Link]
})
[Link]["Items"] = Draw("Text", {
Color = [Link],
Center = true,
Outline = true,
Size = 19,
Visible = [Link] and [Link]
})
[Link]["Health"] = Draw("Line", {
Transparency = 1,
Thickness = 4,
Visible = [Link] and [Link]
})
[Link]["Health2"] = Draw("Line", {
Transparency = 1,
Thickness = 2,
Visible = [Link] and [Link]
})
[Link]["Distance"] = Draw("Text", {
Color = [Link],
Center = true,
Outline = true,
Size = 19,
Visible = [Link] and [Link]
})
[Link]["Tracer"] = Draw("Line", {
Thickness = [Link],
Color = [Link],
Transparency = 1,
Visible = [Link] and [Link]
})
[Link][obj] = box
[Link]:Connect(function(_, parent)
if parent == nil and [Link] ~= false then
box:Remove()
end
end)
obj:GetPropertyChangedSignal("Parent"):Connect(function()
if [Link] == nil and [Link] ~= false then
box:Remove()
end
end)
local hum = obj:FindFirstChildOfClass("Humanoid")
if hum then
[Link]:Connect(function()
if [Link] ~= false then
box:Remove()
end
end)
end
return box
end
local function CharAdded(char)
local p = plrs:GetPlayerFromCharacter(char)
if not char:FindFirstChild("HumanoidRootPart") then
local ev
ev = [Link]:Connect(function(c)
if [Link] == "HumanoidRootPart" then
ev:Disconnect()
ESP:Add(char, {
Name = [Link],
Player = p,
PrimaryPart = c
})
end
end)
else
ESP:Add(char, {
Name = [Link],
Player = p,
PrimaryPart = [Link]
})
end
end
local function PlayerAdded(p)
[Link]:Connect(CharAdded)
if [Link] then
[Link](CharAdded)([Link])
end
end
[Link]:Connect(PlayerAdded)
for i,v in pairs(plrs:GetPlayers()) do
if v ~= plr then
PlayerAdded(v)
end
end
game:GetService("RunService").RenderStepped:Connect(function()
cam = [Link]
for i,v in ([Link] and pairs or ipairs)([Link]) do
if [Link] then
local s,e = pcall([Link], v)
if not s then warn("[EU]", e, [Link]:GetFullName()) end
end
end
end)
return ESP