0% found this document useful (0 votes)
6 views6 pages

Distance ESP Script for Players

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)
6 views6 pages

Distance ESP Script for Players

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

wait(4)

if not game:IsLoaded() then


[Link]:Wait()
end

local esptoggle = "p" -- toggle key

--[Main Variables]

local plrs = game["Players"]


local rs = game["RunService"]
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local Lighting = game:GetService("Lighting")
local Teams = game:GetService("Teams")
local RunService = game:GetService("RunService")
local TeleportService = game:GetService("TeleportService")

local LocalPlayer = [Link]


local Mouse = LocalPlayer:GetMouse()
local CurrentCamera = [Link]
local plr = [Link]
local mouse = plr:GetMouse()
local camera = [Link]
local worldToViewportPoint = [Link]
local cc = [Link]("ColorCorrectionEffect", [Link])
local blur = [Link]("BlurEffect", [Link])
local sun = [Link]("SunRaysEffect", [Link])
[Link] = 0
[Link] = 0

--[Optimisation Variables]

local Drawingnew = [Link]


local Color3fromRGB = [Link]
local Vector3new = [Link]
local Vector2new = [Link]
local mathfloor = [Link]
local mathceil = [Link]

--[Setup Table]

-- [Link]

local esp = {
players = {},
enabled = false,
teamcheck = true,
fontsize = 16,
font = 0,
settings = {
name = {
enabled = true,
outline = true,
color = Color3fromRGB(0, 0, 0),
outlineColor = Color3fromRGB(105, 105, 105)
},
box = {
enabled = true,
outline = true,
color = Color3fromRGB(0, 0, 0),
outlineColor = Color3fromRGB(0, 0, 0)
},
healthbar = {
enabled = true,
outline = true,
color = Color3fromRGB(0, 0, 0),
outlineColor = Color3fromRGB(0, 0, 0)
},
healthtext = {
enabled = true,
outline = true,
color = Color3fromRGB(0, 0, 0),
outlineColor = Color3fromRGB(105, 105, 105)
},
distance = {
enabled = true,
outline = true,
color = Color3fromRGB(0, 0, 0),
outlineColor = Color3fromRGB(105, 105, 105)
}
}
}

[Link] = function(type, properties)


local newDrawing = Drawingnew(type)

for i, v in next, properties or {} do


newDrawing[i] = v
end

return newDrawing
end

[Link] = function(v)
[Link][v] = {
name = [Link](
"Text",
{Color = Color3fromRGB(94, 0, 255), Outline = true, Center = true, Size
= 13, Font = 0}
),
boxOutline = [Link]("Square", {Color = Color3fromRGB(0, 0, 0),
Thickness = 3}),
box = [Link]("Square", {Color = Color3fromRGB(108, 11, 204),
Thickness = 1}),
healthBarOutline = [Link]("Line", {Color = Color3fromRGB(0, 0, 0),
Thickness = 3}),
healthBar = [Link]("Line", {Color = Color3fromRGB(255, 255, 255),
Thickness = 1}),
healthText = [Link](
"Text",
{Color = Color3fromRGB(94, 0, 255), Outline = true, Center = true, Size
= 13, Font = 0}
),
distance = [Link](
"Text",
{Color = Color3fromRGB(94, 0, 255), Outline = true, Center = true, Size
= 13, Font = 0}
)
}
end

for _, v in ipairs(plrs:GetPlayers()) do
[Link](v)
end

[Link]:Connect(
function(v)
[Link](v)
end
)

[Link]:Connect(
function(v)
for i, v in pairs([Link][v]) do
v:Remove()
end
[Link][v] = nil
end
)

local mainLoop =
[Link]:Connect(
function()
for i, v in pairs([Link]) do
if
i ~= plr and [Link] and [Link]:FindFirstChild("Humanoid")
and
[Link]:FindFirstChild("HumanoidRootPart") and
[Link]:FindFirstChild("Head")
then
local hum = [Link]
local hrp = [Link]
local head = [Link]

local Vector, onScreen =


camera:WorldToViewportPoint([Link])

local Size =
(camera:WorldToViewportPoint([Link] - Vector3new(0, 3,
0)).Y -
camera:WorldToViewportPoint([Link] + Vector3new(0, 2.6,
0)).Y) /
2
local BoxSize = Vector2new(mathfloor(Size * 1.5), mathfloor(Size *
1.9))
local BoxPos = Vector2new(mathfloor(Vector.X - Size * 1.5 / 2),
mathfloor(Vector.Y - Size * 1.6 / 2))

local BottomOffset = BoxSize.Y + BoxPos.Y + 1

if onScreen and [Link] then


if [Link] then
[Link] = Vector2new(BoxSize.X / 2 + BoxPos.X,
BoxPos.Y - 16)
[Link] = [Link]
[Link] = tostring(i)
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]

[Link] = true
else
[Link] = false
end

if
[Link] and [Link] and
[Link]:FindFirstChild("HumanoidRootPart")
then
[Link] = Vector2new(BoxSize.X / 2 + BoxPos.X,
BottomOffset)
[Link] = [Link]
[Link] =
"[" .. mathfloor(([Link] -
[Link]).Magnitude) .. "m]"
[Link] = [Link]
[Link] =
[Link]
BottomOffset = BottomOffset + 15

[Link] = [Link]
[Link] = [Link]

[Link] = true
else
[Link] = false
end

if [Link] then
[Link] = BoxSize
[Link] = BoxPos
[Link] = [Link]
[Link] = [Link]

[Link] = BoxSize
[Link] = BoxPos
[Link] = [Link]
[Link] = true
else
[Link] = false
[Link] = false
end

if [Link] then
[Link] = Vector2new((BoxPos.X - 5), BoxPos.Y +
BoxSize.Y)
[Link] =
Vector2new(
[Link].X,
[Link].Y - ([Link] / [Link]) *
BoxSize.Y
)
[Link] = [Link]
[Link] = true

[Link] = Vector2new([Link].X,
BoxPos.Y + BoxSize.Y + 1)
[Link] = Vector2new([Link].X,
([Link].Y - 1 * BoxSize.Y) - 1)
[Link] =
[Link]
[Link] = [Link]
else
[Link] = false
[Link] = false
end

if [Link] then
[Link] = tostring(mathfloor(([Link] /
[Link]) * 100 + 0.5))
[Link] = Vector2new((BoxPos.X - 20),
(BoxPos.Y + BoxSize.Y - 1 * BoxSize.Y) - 1)
[Link] = [Link]
[Link] =
[Link]
[Link] = [Link]

[Link] = [Link]
[Link] = [Link]

[Link] = true
else
[Link] = false
end

if [Link] then
if [Link] ~= [Link] then
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]
else
[Link] = false
[Link] = false
[Link] = false
[Link] = false
[Link] = false
[Link] = false
[Link] = false
end
end
else
[Link] = false
[Link] = false
[Link] = false
[Link] = false
[Link] = false
[Link] = false
[Link] = false
end
else
[Link] = false
[Link] = false
[Link] = false
[Link] = false
[Link] = false
[Link] = false
[Link] = false
end
end
end
)

getgenv().esp = esp
--esp

local mouse = [Link]:GetMouse()

[Link]:Connect(function(value)
if value == esptoggle then
if [Link] == true then
[Link] = false
else
[Link] = true
end
end
end)

You might also like