Esp Lua
Esp Lua
2"
setclipboard('loadstring(game:HttpGet("https://raw.githubusercontent.com/
Spoorloos/scripts/main/pf-actor-bypass.lua"))()')
local a = Instance.new("Message", game.CoreGui)
a.Text = "\nA script has been copied to your clipboard.\nPlease put
this script in your exploit's autoexec folder and rejoin the game.\n(this script is
required to bypass the new update.)"
return
else
local _cache = rawget(debug.getupvalue(require, 1), "_cache")
local ReplicationInterface = rawget(rawget(_cache,
"ReplicationInterface"), "module")
getEntry = rawget(ReplicationInterface, "getEntry")
end
elseif GameId == gids.bb then
for _,v in next, getgc(true) do
if typeof(v) == "table" and rawget(v, "InitProjectile") and rawget(v,
"TS") then
ts = rawget(v, "TS")
characters = ts.Characters
teams = ts.Teams
end
end
elseif GameId == gids.rp then
rp = true
-- CREDIT TO THIS DUDE FOR CRASH FIX https://v3rmillion.net/showthread.php?
pid=8248169#pid8248169
--loadstring(game:HttpGet("https://raw.githubusercontent.com/Github-Account-
39021832/Rush-Point-Fix-Crash/main/src.lua"))()
end
local From = {
UpperTorso = "Head",
LowerTorso = "UpperTorso",
LeftUpperArm = "UpperTorso",
RightUpperArm = "UpperTorso",
LeftLowerArm = "LeftUpperArm",
RightLowerArm = "RightUpperArm",
LeftHand = "LeftLowerArm",
RightHand = "RightLowerArm",
LeftUpperLeg = "LowerTorso",
RightUpperLeg = "LowerTorso",
LeftLowerLeg = "LeftUpperLeg",
RightLowerLeg = "RightUpperLeg",
LeftFoot = "LeftLowerLeg",
RightFoot = "RightLowerLeg",
Torso = "Head",
['Left Arm'] = "Torso",
['Right Arm'] = "Torso",
['Left Leg'] = "Torso",
['Right Leg'] = "Torso",
Chest = "Head",
Hips = "Chest",
LeftArm = "Chest",
LeftForearm = "LeftArm",
RightArm = "Chest",
RightForearm = "RightArm",
LeftLeg = "Hips",
LeftForeleg = "LeftLeg",
RightLeg = "Hips",
RightForeleg = "RightLeg"
}
if ts then
From.LeftHand = "LeftForearm"
From.RightHand = "RightForearm"
From.LeftFoot = "LeftForeleg"
From.RightFoot = "RightForeleg"
end
local supportedparts = {
"CornerWedgePart",
"Model",
"NegateOperation",
"Part",
"TrussPart",
"UnionOperation",
"WedgePart",
"MeshPart"
}
local PlayerObjects = {}
local oldfuncs = {}
function IsAlive(plr)
if plr.ClassName == "Model" then
return true
end
function GetChar(plr)
if plr.ClassName == "Model" then
return plr
end
return plr.Character
end
function GetHealth(plr)
if plr.ClassName == "Model" then
local a = plr.Humanoid
return {mathfloor(a.Health), mathfloor(a.MaxHealth)}
end
function GetTeam(plr)
if plr.ClassName == "Model" then
return "NPC"
end
return plr.Team
end
function GetTeamColor(plr)
if plr.ClassName == "Model" then
return npcs.Color
end
return plr.TeamColor.Color
end
function IsFFA()
local t = {}
for _,v in next, players:GetPlayers() do
local team = GetTeam(v)
if team == nil then
return true
end
do -- compatibility
if getEntry then -- phantom forces
local cache = {}
GetChar = function(plr)
local obj = getEntry(plr)
if obj ~= nil then
local char = obj.Character
if char and char.Parent ~= nil then
return char
end
end
return nil
end
IsAlive = GetChar
GetHealth = function(plr)
local obj = getEntry(plr)
if obj ~= nil then
return {mathfloor(obj.Health), 100}
end
return nil
end
end
oldfuncs.alive = IsAlive
oldfuncs.character = GetChar
oldfuncs.health = GetHealth
oldfuncs.team = GetTeam
oldfuncs.teamcolor = GetTeamColor
oldfuncs.ffa = IsFFA
----
Chest = Drawingnew("Line"),
Hips = Drawingnew("Line"),
LeftArm = Drawingnew("Line"),
LeftForearm = Drawingnew("Line"),
LeftHand = Drawingnew("Line"),
RightArm = Drawingnew("Line"),
RightForearm = Drawingnew("Line"),
RightHand = Drawingnew("Line"),
LeftLeg = Drawingnew("Line"),
LeftForeleg = Drawingnew("Line"),
LeftFoot = Drawingnew("Line"),
RightLeg = Drawingnew("Line"),
RightForeleg = Drawingnew("Line"),
RightFoot = Drawingnew("Line")
}) or { -- 42 objects btw
-- R15
UpperTorsoOutline = Drawingnew("Line"),
LowerTorsoOutline = Drawingnew("Line"),
LeftUpperArmOutline = Drawingnew("Line"),
LeftLowerArmOutline = Drawingnew("Line"),
LeftHandOutline = Drawingnew("Line"),
RightUpperArmOutline = Drawingnew("Line"),
RightLowerArmOutline = Drawingnew("Line"),
RightHandOutline = Drawingnew("Line"),
LeftUpperLegOutline = Drawingnew("Line"),
LeftLowerLegOutline = Drawingnew("Line"),
LeftFootOutline = Drawingnew("Line"),
RightUpperLegOutline = Drawingnew("Line"),
RightLowerLegOutline = Drawingnew("Line"),
RightFootOutline = Drawingnew("Line"),
UpperTorso = Drawingnew("Line"),
LowerTorso = Drawingnew("Line"),
LeftUpperArm = Drawingnew("Line"),
LeftLowerArm = Drawingnew("Line"),
LeftHand = Drawingnew("Line"),
RightUpperArm = Drawingnew("Line"),
RightLowerArm = Drawingnew("Line"),
RightHand = Drawingnew("Line"),
LeftUpperLeg = Drawingnew("Line"),
LeftLowerLeg = Drawingnew("Line"),
LeftFoot = Drawingnew("Line"),
RightUpperLeg = Drawingnew("Line"),
RightLowerLeg = Drawingnew("Line"),
RightFoot = Drawingnew("Line"),
-- R6
TorsoOutline = Drawingnew("Line"),
["Left ArmOutline"] = Drawingnew("Line"),
["Right ArmOutline"] = Drawingnew("Line"),
["Left LegOutline"] = Drawingnew("Line"),
["Right LegOutline"] = Drawingnew("Line"),
Torso = Drawingnew("Line"),
["Left Arm"] = Drawingnew("Line"),
["Right Arm"] = Drawingnew("Line"),
["Left Leg"] = Drawingnew("Line"),
["Right Leg"] = Drawingnew("Line")
}
end,
HealthBars = function()
return {
Outline = Drawingnew("Quad"),
Bar = Drawingnew("Quad")
}
end,
HeadDots = function()
return {
Outline = Drawingnew("Circle"),
Dot = Drawingnew("Circle")
}
end,
LookTracers = function()
return {
Outline = Drawingnew("Line"),
Tracer = Drawingnew("Line")
}
end,
Labels = function()
return {
Label = Drawingnew("Text")
}
end,
Chams = function()
return {
Top = Drawingnew("Quad"),
Bottom = Drawingnew("Quad"),
Left = Drawingnew("Quad"),
Right = Drawingnew("Quad"),
Front = Drawingnew("Quad"),
Back = Drawingnew("Quad")
}
end
}
local RemoveFunction = {
Boxes = function(self)
if self.Destroyed then return end
self.Object.Box:Remove()
self.Object.Outline:Remove()
self.Destroyed = true
end,
Tracers = function(self)
if self.Destroyed then return end
self.Object.Tracer:Remove()
self.Object.Outline:Remove()
self.Destroyed = true
end,
Names = function(self)
if self.Destroyed then return end
self.Object.Name:Remove()
self.Object.Data:Remove()
self.Destroyed = true
end,
Skeletons = function(self)
if self.Destroyed then return end
for _,v in next, self.Object do
v:Remove()
end
self.Destroyed = true
end,
HealthBars = function(self)
if self.Destroyed then return end
self.Object.Bar:Remove()
self.Object.Outline:Remove()
self.Destroyed = true
end,
HeadDots = function(self)
if self.Destroyed then return end
self.Object.Dot:Remove()
self.Object.Outline:Remove()
self.Destroyed = true
end,
LookTracers = function(self)
if self.Destroyed then return end
self.Object.Tracer:Remove()
self.Object.Outline:Remove()
self.Destroyed = true
end,
Labels = function(self)
if self.Destroyed then return end
self.Object.Label:Remove()
self.AncestryChanged:Disconnect()
self.Destroyed = true
end,
Chams = function(self)
if self.Destroyed then return end
self.Object.Top:Remove()
self.Object.Bottom:Remove()
self.Object.Left:Remove()
self.Object.Right:Remove()
self.Object.Front:Remove()
self.Object.Back:Remove()
self.AncestryChanged:Disconnect()
self.Destroyed = true
end
}
function NewObject(type) -- create the actual drawing objects
local obj = Object[type]()
SetProp(obj, "Visible", false)
ApplyZIndex(obj, type)
return obj
end
function NewCharacterObject(objs, type, plr) -- create data object for players and
npcs
ID += 1
local t = {
Object = objs,
Type = type,
Player = plr,
NPC = plr.ClassName ~= "Player",
Destroyed = false,
Id = ID,
Remove = RemoveFunction[type]
}
OBJECTS[ID] = t
return t
end
local props = {
Labels = {
Text = "string",
Transparency = "number",
Color = "Color3",
RainbowColor = "boolean",
Size = "number",
Outline = "boolean",
OutlineColor = "Color3",
Font = "number",
Offset = "Vector2"
},
Chams = {
Transparency = "number",
Color = "Color3",
RainbowColor = "boolean",
Thickness = "number",
Filled = "boolean"
}
}
function PartSetPart(self, p) -- SetPart function for labels and chams
assert(typeof(p) == "Instance", ("Universal Esp: bad argument #1 to 'SetPart'
(Instance expected, got %s)"):format(typeof(p)))
assert(tablefind(supportedparts, p.ClassName), ("Universal Esp: bad argument
#1 to 'SetPart' (BasePart or Model expected, got %s)"):format(p.ClassName))
self.Part = p
end
function PartSetProp(self, prop, value) -- SetProp function for labels and chams
assert(prop ~= nil, "Universal Esp: bad argument #1 to 'SetProp' (property is
nil)")
assert(self.Options[prop] ~= nil, "Universal Esp: bad argument #1 to
'SetProp' (invalid property)")
local expected, got = props[self.Type][prop], typeof(value)
assert(expected == got,("Universal Esp: bad argument to #2 'SetProp' (%s
expected, got %s)"):format(expected, got))
self.Options[prop] = value
end
function NewPartObject(objs, type, part, options) -- create data object for parts
and models
ID += 1
local t = {
Object = objs,
Type = type,
Part = part,
Options = options,
Destroyed = false,
Id = ID,
AncestryChanged = nil,
SetPart = PartSetPart,
SetProp = PartSetProp,
Remove = RemoveFunction[type]
}
t.AncestryChanged = part.AncestryChanged:Connect(function(_, parent)
if parent == nil then
t:Remove()
return
end
t:SetPart(parent:FindFirstChild(part.Name))
end)
OBJECTS[ID] = t
return t
end
local ss = getgenv().EspSettings
local origins = {}
local mousepos = Vector2.zero
local ffa = IsFFA()
local myteam = GetTeam(player)
local ccf = camera.CFrame.Position
local camfov = camera.FieldOfView
local rainbow = fromHSV(tick() % 5 / 5, 1, 1)
local teamcheck = ss.TeamCheck
local maxdist = ss.MaximumDistance
local facecamera = ss.FaceCamera
local alignpoints = ss.AlignPoints
local refreshrate = ss.RefreshRate / 1000
if mv_enabled then
local method = mv_method
if method == "radius" or not method then
local mags = {}
tableinsert(mags, (mousepos - Vector2new(mid.X,
mid.Y)).Magnitude)
tableinsert(mags, (mousepos - Vector2new(tlx,
tly)).Magnitude)
tableinsert(mags, (mousepos - Vector2new(trx,
try)).Magnitude)
tableinsert(mags, (mousepos - Vector2new(blx,
bly)).Magnitude)
tableinsert(mags, (mousepos - Vector2new(brx,
bry)).Magnitude)
tablesort(mags, function(a,b)
return a < b
end)
local y_min_offset = 0
local y_max_offset = 0
if Names.Enabled then
y_min_offset = Names.Size - 2
if Names.ShowHealth or Names.ShowDistance
then
y_max_offset += Names.Size + 2
end
end
if HealthBars.Enabled then
y_max_offset += z
end
local y_min = mathmin(tly, try, bly, bry) -
y_min_offset - mv_hoverradius
local y_max = mathmax(tly, try, bly, bry) +
y_max_offset + mv_hoverradius
if BOXES then
local type = "Boxes"
local certified_npc = isnpc and npc_overrides[type]
local color = (highlight and hl_color) or
(certified_npc and
(npc_rainbow and rainbow or npc_color)) or
(Boxes.RainbowColor and
rainbow) or
(Boxes.UseTeamColor and
teamcolor) or
Boxes.Color
local transparency = (mv_enabled and mv_selected[type] and
overlapping and mv_transparency) or
(certified_npc and
npc_transparency) or
(highlight and
hl_transparency) or
Boxes.Transparency
ApplyZIndex(box, type, highlight and hl_ontop)
SetProp(box, "Color", color)
SetProp(box, "Transparency", transparency)
if OUTLINES then
out.Visible = Boxes.Outline and box.Visible
if Boxes.Outline then
out.Color = Boxes.OutlineColor
out.Thickness = Boxes.Thickness +
(Boxes.OutlineThickness * 2)
out.PointA = box.PointA
out.PointB = box.PointB
out.PointC = box.PointC
out.PointD = box.PointD
end
end
end
if TRACERS then
local type = "Tracers"
local certified_npc = isnpc and npc_overrides[type]
local color = (highlight and hl_color) or
(certified_npc and
(npc_rainbow and rainbow or npc_color)) or
(Tracers.RainbowColor and
rainbow) or
(Tracers.UseTeamColor and
teamcolor) or
Tracers.Color
local transparency = (mv_enabled and mv_selected[type] and
overlapping and mv_transparency) or
(certified_npc and
npc_transparency) or
(highlight and
hl_transparency) or
Tracers.Transparency
ApplyZIndex(tracer, type, highlight and hl_ontop)
SetProp(tracer, "Color", color)
SetProp(tracer, "Transparency", transparency)
if OUTLINES then
out.Visible = outline and tracer.Visible
if outline then
out.Color = Tracers.OutlineColor
out.Thickness = thickness +
(Tracers.OutlineThickness * 2)
out.From = from
out.To = to
end
end
end
if NAMES then
local type = "Names"
local certified_npc = isnpc and npc_overrides[type]
local color = (highlight and hl_color) or
(certified_npc and
(npc_rainbow and rainbow or npc_color)) or
(Names.RainbowColor and
rainbow) or
(Names.UseTeamColor and
teamcolor) or
Names.Color
local transparency = (mv_enabled and mv_selected[type] and
overlapping and mv_transparency) or
(certified_npc and
npc_transparency) or
(highlight and
hl_transparency) or
Names.Transparency
ApplyZIndex(name, type, highlight and hl_ontop)
SetProp(name, "Color", color)
SetProp(name, "Transparency", transparency)
if isnpc then
name.Text = "[NPC] "
end
name.Text = (Names.UseDisplayName and plr.DisplayName) or
plr.Name
data.Text = ""
if Names.ShowDistance then
data.Text =
"[ "..mathfloor(mag)..Names.DistanceDataType.." ]"
end
if Names.ShowHealth then
local a = lower(Names.HealthDataType)
if a == "percentage" then
data.Text = data.Text.." [ "..mathfloor((health
/ maxhealth) * 100).."% ]"
elseif a == "value" then
data.Text = data.Text.."
[ "..mathfloor(health).."/"..mathfloor(maxhealth).." ]"
end
end
end
if SKELETONS then
local type = "Skeletons"
local certified_npc = isnpc and npc_overrides[type]
local color = (highlight and hl_color) or
(certified_npc and
(npc_rainbow and rainbow or npc_color)) or
(Skeletons.RainbowColor and
rainbow) or
(Skeletons.UseTeamColor and
teamcolor) or
Skeletons.Color
local transparency = (mv_enabled and mv_selected[type] and
overlapping and mv_transparency) or
(certified_npc and
npc_transparency) or
(highlight and
hl_transparency) or
Skeletons.Transparency
ApplyZIndex(skeleton, type, highlight and hl_ontop)
SetProp(skeleton, "Color", color)
SetProp(skeleton, "Transparency", transparency)
if HEALTHBARS then
local type = "HealthBars"
local certified_npc = isnpc and npc_overrides[type]
local color = (highlight and hl_color) or
(certified_npc and
(npc_rainbow and rainbow or npc_color)) or
(HealthBars.RainbowColor and
rainbow) or
(HealthBars.UseTeamColor and
teamcolor) or
HealthBars.Color
local transparency = (mv_enabled and mv_selected[type] and
overlapping and mv_transparency) or
(certified_npc and
npc_transparency) or
(highlight and
hl_transparency) or
HealthBars.Transparency
ApplyZIndex(bar, type, highlight and hl_ontop)
SetProp(bar, "Color", color)
SetProp(bar, "Transparency", transparency)
bar.PointA = Vector2new(
left + (right - left) * health,
(lefty + (righty - lefty) * health) + 5
)
bar.PointB = Vector2new(
left,
lefty + 5
)
bar.PointC = Vector2new(
left,
lefty + z
)
bar.PointD = Vector2new(
left + (right - left) * health,
(lefty + (righty - lefty) * health) + z
)
if OUTLINES then
out.Visible = outline and bar.Visible
if outline then
out.Color = HealthBars.OutlineColor
out.Thickness = HealthBars.OutlineThickness * 2
out.PointA = (baronly and bar.PointA) or
Vector2new(brx, bry + 5)
out.PointB = (baronly and bar.PointB) or
Vector2new(blx, bly + 5)
out.PointC = (baronly and bar.PointC) or
Vector2new(blx, bly + z)
out.PointD = (baronly and bar.PointD) or
Vector2new(brx, bry + z)
end
end
end
if HEADDOTS then
local type = "HeadDots"
local certified_npc = isnpc and npc_overrides[type]
local color = (highlight and hl_color) or
(certified_npc and
(npc_rainbow and rainbow or npc_color)) or
(HeadDots.RainbowColor and
rainbow) or
(HeadDots.UseTeamColor and
teamcolor) or
HeadDots.Color
local transparency = (mv_enabled and mv_selected[type] and
overlapping and mv_transparency) or
(certified_npc and
npc_transparency) or
(highlight and
hl_transparency) or
HeadDots.Transparency
ApplyZIndex(dot, type, highlight and hl_ontop)
SetProp(dot, "Color", color)
SetProp(dot, "Transparency", transparency)
head = char:FindFirstChild("Head")
if head then
local headcf = head.CFrame
head = WorldToViewportPoint(camera, headcf.Position)
end
if head then
local thickness, outline, filled =
HeadDots.Thickness, HeadDots.Outline, HeadDots.Filled
local dot, out = dot.Dot, dot.Outline
dot.Thickness = thickness
dot.Filled = filled
if OUTLINES then
out.Visible = outline and dot.Visible
if outline then
local othickness = thickness +
(HeadDots.OutlineThickness * 2)
out.Color = HeadDots.OutlineColor
out.Thickness = (filled and thickness +
(othickness - 1)) or othickness
out.Position = pos
out.Radius = (filled and radius + 1) or
radius
end
end
else
SetProp(dot, "Visible", false)
end
end
if LOOKTRACERS then
local type = "LookTracers"
local certified_npc = isnpc and npc_overrides[type]
local color = (highlight and hl_color) or
(certified_npc and
(npc_rainbow and rainbow or npc_color)) or
(LookTracers.RainbowColor
and rainbow) or
(LookTracers.UseTeamColor
and teamcolor) or
LookTracers.Color
local transparency = (mv_enabled and mv_selected[type] and
overlapping and mv_transparency) or
(certified_npc and
npc_transparency) or
(highlight and
hl_transparency) or
LookTracers.Transparency
ApplyZIndex(ltracer, type, highlight and hl_ontop)
SetProp(ltracer, "Color", color)
SetProp(ltracer, "Transparency", transparency)
head = char:FindFirstChild("Head")
if head then
local headcf = head.CFrame
head = WorldToViewportPoint(camera, headcf.Position)
ltracerto = WorldToViewportPoint(camera, (headcf *
CFramenew(0, 0, -LookTracers.Length)).Position)
end
if head then
local thickness, outline = LookTracers.Thickness,
LookTracers.Outline
local tracer, out = ltracer.Tracer, ltracer.Outline
tracer.Thickness = thickness
if OUTLINES then
out.Visible = outline and tracer.Visible
if outline then
out.Color = LookTracers.OutlineColor
out.Thickness = thickness +
(LookTracers.OutlineThickness * 2)
out.From = from
out.To = to
end
end
else
SetProp(ltracer, "Visible", false)
end
end
end
else
SetProp(box, "Visible", false)
SetProp(tracer, "Visible", false)
SetProp(name, "Visible", false)
SetProp(skeleton, "Visible", false)
SetProp(bar, "Visible", false)
SetProp(dot, "Visible", false)
SetProp(ltracer, "Visible", false)
end
end
function UpdatePartObjects(self) -- update esp objects for parts and models
local part = self.Part
local type = self.Type
local obj = self.Objects
local s = self.Options
local cf, size, inViewport
local c0, c1, c2, c3, c4, c5, c6, c7, c8
if VISIBLE then
local class = part.ClassName
if find(class, "Part") or find(class, "Operation") then
cf, size = part.CFrame, part.Size / 2
elseif class == "Model" then
cf, size = part:GetBoundingBox()
size /= 2
end
local x, y, z = size.X, size.Y, size.Z
c0, inViewport = WorldToViewportPoint(camera,cf.Position)
if type == "Chams" and inViewport then
c1 = WorldToViewportPoint(camera, (cf * CFramenew( x, y,
z)).Position)
c2 = WorldToViewportPoint(camera, (cf * CFramenew(-x, y,
z)).Position)
c3 = WorldToViewportPoint(camera, (cf * CFramenew(-x, -y,
z)).Position)
c4 = WorldToViewportPoint(camera, (cf * CFramenew( x, -y,
z)).Position)
c5 = WorldToViewportPoint(camera, (cf * CFramenew( x, y, -
z)).Position)
c6 = WorldToViewportPoint(camera, (cf * CFramenew(-x, y, -
z)).Position)
c7 = WorldToViewportPoint(camera, (cf * CFramenew(-x, -y, -
z)).Position)
c8 = WorldToViewportPoint(camera, (cf * CFramenew( x, -y, -
z)).Position)
c1 = Vector2new(c1.X, c1.Y)
c2 = Vector2new(c2.X, c2.Y)
c3 = Vector2new(c3.X, c3.Y)
c4 = Vector2new(c4.X, c4.Y)
c5 = Vector2new(c5.X, c5.Y)
c6 = Vector2new(c6.X, c6.Y)
c7 = Vector2new(c7.X, c7.Y)
c8 = Vector2new(c8.X, c8.Y)
end
if inViewport then
local color = (s.RainbowColor and rainbow) or s.Color
SetProp(obj, "Transparency", s.Transparency)
SetProp(obj, "Color", color)
if type == "Labels" then
local label = obj.Label
label.Text = s.Text
label.Size = s.Size
label.Outline = s.Outline
label.OutlineColor = s.OutlineColor
label.Font = s.Font
t.PointA = c5
t.PointB = c6
t.PointC = c2
t.PointD = c1
b.PointA = c4
b.PointB = c3
b.PointC = c7
b.PointD = c8
l.PointA = c2
l.PointB = c6
l.PointC = c7
l.PointD = c3
r.PointA = c5
r.PointB = c1
r.PointC = c4
r.PointD = c8
f.PointA = c1
f.PointB = c2
f.PointC = c3
f.PointD = c4
bb.PointA = c5
bb.PointB = c6
bb.PointC = c7
bb.PointD = c8
end
end
else
SetProp(obj, "Visible", false)
end
end
function UpdateParallel(self) -- begin the loop that calls the update function
taskspawn(function()
while true do
local clock = osclock()
if refreshrate > 0 and (clock - self.LastUpdate) < refreshrate
then
taskwait()
continue
end
self.LastUpdate = clock
if self.Destroyed then
break
end
self:Update()
taskwait()
end
end)
end
function NewDrawing(type, target, options) -- create esp objects and data objects
local drawobjs = NewObject(type)
local obj = (options ~= nil and NewPartObject(drawobjs, type, target,
options)) or NewCharacterObject(drawobjs, type, target)
return drawobjs, obj
end
function NewPlayer(plr)
local Box, BoxObj = NewDrawing("Boxes", plr)
SetProp(Box, "Filled", false)
local t = {}
t.Destroyed = false
t.Player = plr
t.NPC = plr.ClassName ~= "Player"
t.Objects = {
Box = BoxObj,
Tracer = TracerObj,
Name = NameObj,
Skeleton = SkeletonObj,
HealthBar = HealthBarObj,
HeadDot = HeadDotObj,
LookTracer = LookTracerObj
}
t.Update = UpdateObjects
t.LastUpdate = osclock()
t.Destroy = function(self)
if self.Destroyed then return end
self.Destroyed = true
for _,v in next, self.Objects do
v:Remove()
end
end
PlayerObjects[plr] = t
UpdateParallel(t)
end
local t = {}
t.Destroyed = false
t.Part = part
t.Options = o
t.Objects = LabelObj.Object
t.Type = "Labels"
t.Update = UpdatePartObjects
t.LastUpdate = osclock()
t.Destroy = function(self)
if self.Destroyed then return end
self.Destroyed = true
for _,v in next, self.Objects do
v:Remove()
end
end
PlayerObjects[part] = t
UpdateParallel(t)
return LabelObj
end
function NewCham(part, options)
local o = {
Transparency = options.Transparency or 1,
Color = options.Color or white,
RainbowColor = ternary(options.RainbowColor ~= nil,
options.RainbowColor, false),
Thickness = options.Thickness or 3,
Filled = ternary(options.Filled ~= nil, options.Filled, true)
}
local t = {}
t.Destroyed = false
t.Part = part
t.Options = o
t.Type = "Chams"
t.Objects = ChamObj.Object
t.Update = UpdatePartObjects
t.LastUpdate = osclock()
t.Destroy = function(self)
if self.Destroyed then return end
self.Destroyed = true
for _,v in next, self.Objects do
v:Remove()
end
end
PlayerObjects[part] = t
UpdateParallel(t)
return ChamObj
end
function ValidType(type)
return type == "Other" or ss[type] ~= nil
end
function ValidOption(type,option)
return (type == "Other" and ss[option] ~= nil) or ss[type][option] ~= nil
end
function esp:Toggle(type)
assert(ValidType(type),"Universal Esp: bad argument to #1 'Toggle' (Invalid
Type)")
if ss[type].Enabled == nil then
ss[type] = not ss[type]
else
ss[type].Enabled = not ss[type].Enabled
end
end
function esp:Get(type,option)
assert(ValidType(type),"Universal Esp: bad argument to #1 'Get' (Invalid
Type)")
assert(ValidOption(type, option),"Universal Esp: bad argument to #2 'Get'
(Invalid Option)")
if type == "Other" then
return ss[option]
end
return ss[type][option]
end
function esp:Set(type,option,value)
assert(ValidType(type),"Universal Esp: bad argument to #1 'Set' (Invalid
Type)")
assert(ValidOption(type, option),"Universal Esp: bad argument to #2 'Set'
(Invalid Option)")
assert(value ~= nil,"Universal Esp: bad argument to #3 'Set'")
if type == "Other" then
ss[option] = value
else
ss[type][option] = value
end
end
function esp:SetAll(option,value)
assert(Base[option] == nil,"Universal Esp: bad argument to #1 'SetAll'
(Invalid Option)")
assert(value ~= nil,"Universal Esp: bad argument to #2 'SetAll'")
for i,v in next, ss do
if typeof(v) == "table" and zindex[i] ~= nil then
v[option] = value
end
end
end
function esp.Label(part,options)
assert(typeof(part) == "Instance", ("Universal Esp: bad argument to #1
'Label' (Instance expected, got %s)"):format(typeof(part)))
assert(table.find(supportedparts, part.ClassName),("Universal Esp: bad
argument to #1 'Label' (Part or Model expected, got %s)"):format(part.ClassName))
return NewLabel(part, options or {})
end
function esp.Cham(part,options)
assert(typeof(part) == "Instance",("Universal Esp: bad argument to #1 'Cham'
(Instance expected, got %s)"):format(typeof(part)))
assert(table.find(supportedparts, part.ClassName),("Universal Esp: bad
argument to #1 'Cham' (Part or Model expected, got %s)"):format(part.ClassName))
return NewCham(part, options or {})
end
function esp:GetObjects(a)
a = a or ""
local t = typeof(a)
if (t == "Instance" and a.ClassName == "Player") or (t == "string" and
players:FindFirstChild(a)) then
local plr = (t == "string" and players[a]) or a
local objects = {
['Boxes'] = nil,
['Tracers'] = nil,
['Names'] = nil,
['Skeletons'] = nil,
['HealthBars'] = nil,
['HeadDots'] = nil,
['LookTracers'] = nil
}
for _,v in next, OBJECTS do
if v.Player == plr then
objects[v.Type] = v
end
end
return objects
elseif typeof(a) == "string" then
if zindex[a] ~= nil then
local objects = {}
for _,v in next, OBJECTS do
if v.Type == a then
tableinsert(objects, v)
end
end
return objects
elseif a == "" then
return OBJECTS
end
end
return {}
end
function esp:GetTotalObjects()
local data = {
DrawingObjects = 0,
VisibleObjects = 0,
DestroyedObjects = 0,
NPCObjects = 0,
Boxes = 0,
Tracers = 0,
Names = 0,
Skeletons = 0,
HealthBars = 0,
HeadDots = 0,
LookTracers = 0,
Labels = 0,
Chams = 0,
Outlines = 0
}
for _,v in next, OBJECTS do
for i2,v2 in next, v.Object do
if not v.Destroyed then
data.DrawingObjects += 1
if v2.Visible then
data.VisibleObjects += 1
end
if v.NPC then
data.NPCObjects += 1
end
if find(i2, "Outline") then
data.Outlines += 1
else
data[v.Type] += 1
end
else
data.DestroyedObjects += 1
end
end
end
return data
end
function esp:GetObjectFromId(id)
return OBJECTS[id]
end
function hasesp(a)
for _,v in next, OBJECTS do
if (v.Player ~= nil or v.NPC) and v.Player == a and not v.Destroyed
then
return true
end
end
return false
end
function esp:Add(a)
a = a or ""
local t = typeof(a)
if (t == "Instance" and a.ClassName == "Player" or a.ClassName == "Model") or
(t == "string" and players:FindFirstChild(a)) then
local plr = (t == "string" and players[a]) or a
if not hasesp(plr) then
NewPlayer(plr)
end
end
end
function esp:Remove(a)
a = a or ""
local t = typeof(a)
if (t == "Instance" and a.ClassName == "Player" or a.ClassName == "Model") or
(t == "string" and players:FindFirstChild(a)) then
local plr = (t == "string" and players[a]) or a
if hasesp(plr) then
for _,v in next, OBJECTS do
if v.Player ~= nil and v.Player == plr then
v:Remove()
end
end
end
end
end
--[[function esp:DisableOutlines()
OUTLINES = false
for _,v in next, OBJECTS do
for i2,v2 in next, v.Object do
if i2:find("Outline") then
v2:Remove()
end
end
end
end]]
function esp:SetFunction(a,f)
assert(typeof(a) == "string",("Universal Esp: bad argument to #1
'SetFunction' (string expected, got %s)"):format(typeof(a)))
assert(typeof(f) == "function",("Universal Esp: bad argument to #2
'SetFunction' (function expected, got %s)"):format(typeof(f)))
a = lower(a)
assert(oldfuncs[a] ~= nil,"Universal Esp: bad argument to #1 'SetFunction'
(invalid function)")
if a == "alive" then -- ik it looks like shit stfu
IsAlive = f
elseif a == "character" then
GetChar = f
elseif a == "health" then
GetHealth = f
elseif a == "team" then
GetTeam = f
elseif a == "teamcolor" then
GetTeamColor = f
elseif a == "ffa" then
IsFFA = f
end
end
function esp:ResetFunction(a)
assert(typeof(a) == "string",("Universal Esp: bad argument to #1
'ResetFunction' (string expected, got %s)"):format(typeof(a)))
a = lower(a)
assert(oldfuncs[a] ~= nil,"Universal Esp: bad argument to #1 'ResetFunction'
(invalid function)")
local f = oldfuncs[a]
if a == "alive" then
IsAlive = f
elseif a == "character" then
GetChar = f
elseif a == "health" then
GetHealth = f
elseif a == "team" then
GetTeam = f
elseif a == "teamcolor" then
GetTeamColor = f
elseif a == "ffa" then
IsFFA = f
end
end
function esp:Destroy()
if destroyed then return end
conn2:Disconnect()
conn3:Disconnect()
conn4:Disconnect()
for _,v in next, PlayerObjects do
v:Destroy()
end
for _,v in next, OBJECTS do
--v:Remove()
end
destroyed = true
end
getgenv().UESP = esp
return esp