Panel Commands
Panel Commands
Panel Commands
Enabled = true,
Boxes = true,
Tracers = true,
BoxShift = CFrame.new(0,-1.5,0),
BoxSize = Vector3.new(4,6,0),
Color = Color3.fromRGB(255, 170, 0),
FaceCamera = true,
Names = true,
DistanceESP = true,
TeamColor = true,
Thickness = 2,
AttachShift = 1,
TeamMates = true,
Players = true,
Friends = true,
DistanceSize = 14,
NameSize = 13,
--Declarations--
local cam = workspace.CurrentCamera
local plrs = game:GetService("Players")
local plr = plrs.LocalPlayer
local mouse = plr:GetMouse()
--Functions--
local function Draw(obj, props)
local new = Drawing.new(obj)
props = props or {}
for i,v in pairs(props) do
new[i] = v
end
return new
end
function ESP:GetTeam(p)
local ov = self.Overrides.GetTeam
if ov then
return ov(p)
end
function ESP:IsTeamMate(p)
local ov = self.Overrides.IsTeamMate
if ov then
return ov(p)
end
return self:GetTeam(p) == self:GetTeam(plr)
end
function ESP:GetColor(obj)
local ov = self.Overrides.GetColor
if ov then
return ov(obj)
end
local p = self:GetPlrFromChar(obj)
return p and self.TeamColor and p.Team and p.Team.TeamColor.Color or
self.Color
end
function ESP:GetPlrFromChar(char)
local ov = self.Overrides.GetPlrFromChar
if ov then
return ov(char)
end
return plrs:GetPlayerFromCharacter(char)
end
function ESP:Toggle(bool)
self.Enabled = bool
if not bool then
for i,v in pairs(self.Objects) do
if v.Type == "Box" then --fov circle etc
if v.Temporary then
v:Remove()
else
for i,v in pairs(v.Components) do
v.Visible = false
end
end
end
end
end
end
function ESP:GetBox(obj)
return self.Objects[obj]
end
if options.Recursive then
parent.DescendantAdded:Connect(NewListener)
for i,v in pairs(parent:GetDescendants()) do
coroutine.wrap(NewListener)(v)
end
else
parent.ChildAdded:Connect(NewListener)
for i,v in pairs(parent:GetChildren()) do
coroutine.wrap(NewListener)(v)
end
end
end
local boxBase = {}
boxBase.__index = boxBase
function boxBase:Remove()
ESP.Objects[self.Object] = nil
for i,v in pairs(self.Components) do
v.Visible = false
v:Remove()
self.Components[i] = nil
end
end
function boxBase:Update()
if not self.PrimaryPart then
--warn("not supposed to print", self.Object)
return self:Remove()
end
local FriendCheck =
game.Players.LocalPlayer:IsFriendsWith(game.Players:FindFirstChild(`{self.Name}`).U
serId)
local color
if ESP.Highlighted == self.Object then
color = ESP.HighlightColor
else
color = self.Color or self.ColorDynamic and self:ColorDynamic() or
ESP:GetColor(self.Object) or ESP.Color
end
--calculations--
local cf = self.PrimaryPart.CFrame
if ESP.FaceCamera then
cf = CFrame.new(cf.p, cam.CFrame.p)
end
local size = self.Size
local locs = {
TopLeft = cf * ESP.BoxShift * CFrame.new(size.X/2,size.Y/2,0),
TopRight = cf * ESP.BoxShift * CFrame.new(-size.X/2,size.Y/2,0),
BottomLeft = cf * ESP.BoxShift * CFrame.new(size.X/2,-size.Y/2,0),
BottomRight = cf * ESP.BoxShift * CFrame.new(-size.X/2,-size.Y/2,0),
TagPos = cf * ESP.BoxShift * CFrame.new(0,size.Y/2,0) +
Vector3.new(0,2.5,0),
Torso = cf * ESP.BoxShift
}
if ESP.Boxes then
local TopLeft, Vis1 = WorldToViewportPoint(cam, locs.TopLeft.p)
local TopRight, Vis2 = WorldToViewportPoint(cam, locs.TopRight.p)
local BottomLeft, Vis3 = WorldToViewportPoint(cam, locs.BottomLeft.p)
local BottomRight, Vis4 = WorldToViewportPoint(cam, locs.BottomRight.p)
if self.Components.Quad then
if Vis1 or Vis2 or Vis3 or Vis4 then
self.Components.Quad.Visible = true
self.Components.Quad.PointA = Vector2.new(TopRight.X, TopRight.Y)
self.Components.Quad.PointB = Vector2.new(TopLeft.X, TopLeft.Y)
self.Components.Quad.PointC = Vector2.new(BottomLeft.X,
BottomLeft.Y)
self.Components.Quad.PointD = Vector2.new(BottomRight.X,
BottomRight.Y)
if ESP.Friends and FriendCheck then
self.Components.Quad.Color = Color3.fromRGB(111, 227, 142)
else
self.Components.Quad.Color = color
end
else
self.Components.Quad.Visible = false
end
end
else
self.Components.Quad.Visible = false
end
if ESP.Names then
local TagPos, Vis5 = WorldToViewportPoint(cam, locs.TagPos.p)
if Vis5 then
self.Components.Name.Visible = true
self.Components.Name.Position = Vector2.new(TagPos.X, TagPos.Y + 2)
self.Components.Name.Text = self.Name
self.Components.Name.Size = ESP.NameSize or 14
if ESP.DistanceESP then
self.Components.Distance.Visible = true
self.Components.Distance.Position = Vector2.new(TagPos.X, TagPos.Y
+ 14)
self.Components.Distance.Text = math.floor((cam.CFrame.p -
cf.p).magnitude) .."m away"
self.Components.Distance.Size = ESP.DistanceSize or 19
if ESP.Friends and FriendCheck then
self.Components.Distance.Color = Color3.fromRGB(111, 227, 142)
else
self.Components.Distance.Color = color
end
end
if ESP.Tracers then
local TorsoPos, Vis6 = WorldToViewportPoint(cam, locs.Torso.p)
local mouse = game.Players.LocalPlayer:GetMouse()
local distance = (locs.Torso.Position -
game.Players.LocalPlayer.Character.PrimaryPart.Position).magnitude
if self:GetBox(obj) then
self:GetBox(obj):Remove()
end
box.Components["Quad"] = Draw("Quad", {
Thickness = self.Thickness,
Color = color,
Transparency = 1,
Filled = false,
Visible = self.Enabled and self.Boxes
})
box.Components["Name"] = Draw("Text", {
Text = box.Name,
Color = box.Color,
Center = true,
Outline = true,
Size = 14,
Visible = self.Enabled and self.Names
})
box.Components["Distance"] = Draw("Text", {
Color = box.Color,
Center = true,
Outline = true,
Size = 19,
Visible = self.Enabled and self.Names
})
box.Components["Tracer"] = Draw("Line", {
Thickness = ESP.Thickness,
Color = box.Color,
Transparency = 1,
Visible = self.Enabled
})
self.Objects[obj] = box
obj.AncestryChanged:Connect(function(_, parent)
if parent == nil and ESP.AutoRemove ~= false then
box:Remove()
end
end)
obj:GetPropertyChangedSignal("Parent"):Connect(function()
if obj.Parent == nil and ESP.AutoRemove ~= false then
box:Remove()
end
end)
return box
end
game:GetService("RunService").RenderStepped:Connect(function()
cam = workspace.CurrentCamera
for i,v in (ESP.Enabled and pairs or ipairs)(ESP.Objects) do
if v.Update then
local s,e = pcall(v.Update, v)
if not s then warn("[EU]", e, v.Object:GetFullName()) end
end
end
end)
return ESP