0% found this document useful (0 votes)
23 views7 pages

Message 3

The document contains a Lua script designed for a game environment that manages player highlights and visual indicators. It defines various functions and variables for creating and updating visual elements such as boxes and names around players, while also handling player connections and disconnections. The script includes features for toggling visibility and customizing the appearance of these indicators based on player attributes and distance.

Uploaded by

Jon Phillip
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)
23 views7 pages

Message 3

The document contains a Lua script designed for a game environment that manages player highlights and visual indicators. It defines various functions and variables for creating and updating visual elements such as boxes and names around players, while also handling player connections and disconnections. The script includes features for toggling visibility and customizing the appearance of these indicators based on player attributes and distance.

Uploaded by

Jon Phillip
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

-- Variables

local FillColor = [Link](0, 138, 142)


local DepthMode = "AlwaysOnTop"
local FillTransparency = 0.5
local OutlineColor = [Link](255, 255, 255)
local OutlineTransparency = 0
local CoreGui = game:FindService("CoreGui")
local Players = game:FindService("Players")
local connections = {}

local Storage = [Link]("Folder")


[Link] = CoreGui
[Link] = "Highlight_Storage"

local players = cloneref(game:GetService("Players"))


local client = [Link]
local camera = [Link]

getgenv().global = getgenv()

function [Link](self, index, value, check)


if self[index] == nil then
self[index] = value
elseif check then
local methods = { "remove", "Disconnect" }

for _, method in methods do


pcall(function()
value[method](value)
end)
end
end

return self[index]
end

declare(global, "services", {})

function [Link](service)
return services[service]
end

declare(declare(services, "loop", {}), "cache", {})

get("loop").new = function(self, index, func, disabled)


if disabled == nil and (func == nil or typeof(func) == "boolean") then
disabled = func func = index
end

[Link][index] = {
["enabled"] = (not disabled),
["func"] = func,
["toggle"] = function(self, boolean)
if boolean == nil then
[Link] = not [Link]
else
[Link] = boolean
end
end,
["remove"] = function()
[Link][index] = nil
end
}

return [Link][index]
end

declare(get("loop"), "connection",
cloneref(game:GetService("RunService")).RenderStepped:Connect(function(delta)
for _, loop in get("loop").cache do
if [Link] then
local success, result = pcall(function()
[Link](delta)
end)

if not success then


warn(result)
end
end
end
end), true)

declare(services, "new", {})

get("new").drawing = function(class, properties)


local drawing = [Link](class)
for property, value in properties do
pcall(function()
drawing[property] = value
end)
end
return drawing
end

declare(declare(services, "player", {}), "cache", {})

get("player").find = function(self, player)


for character, data in [Link] do
if [Link] == player then
return character
end
end
end

get("player").check = function(self, player)


local success, check = pcall(function()
local character = player:IsA("Player") and [Link] or player
local children =
{[Link]:WaitForChild('HumanoidRootPart')}

return children and [Link] ~= nil


end)

return success and check


end

get("player").new = function(self, player)


-- Prevent applying ESP to local player
if player == client then return end

local function cache(character)


print("caching", character)
[Link][character] = {
["player"] = player,
["drawings"] = {
["box"] = get("new").drawing("Square", { Visible = false }),
["boxFilled"] = get("new").drawing("Square", { Visible = false,
Filled = true }),
["boxOutline"] = get("new").drawing("Square", { Visible = false }),
["name"] = get("new").drawing("Text", { Visible = false, Center =
true}),
["distance"] = get("new").drawing("Text", { Visible = false, Center
= true}),
},
["highlight"] = nil
}

local Highlight = [Link]("Highlight")


[Link] = [Link]
[Link] = FillColor
[Link] = DepthMode
[Link] = FillTransparency
[Link] = OutlineColor
[Link] = OutlineTransparency
[Link] = Storage
if character then
[Link] = character
end
[Link][character].highlight = Highlight
connections[player] = [Link]:Connect(function(char)
[Link] = char
end)
end

local function check(character)


if self:check(character) then
cache(character)
else
local listener
listener = [Link]:Connect(function()
if self:check(character) then
cache(character) listener:Disconnect()
end
end)
end
end

if [Link] then check([Link]) end


[Link]:Connect(check)
end

get("player").remove = function(self, player)


if player:IsA("Player") then
local character = self:find(player)
if character then
self:remove(character)
end
else
local data = [Link][player]
local drawings = [Link]
local highlight = [Link]

[Link][player] = nil

for _, drawing in drawings do


drawing:Remove()
end

if highlight then
highlight:Destroy()
end

if connections[player] then
connections[player]:Disconnect()
end
end
end

get("player").update = function(self, character, data)


if not self:check(character) then
self:remove(character)
end

local player = [Link]


local root = [Link]:WaitForChild('HumanoidRootPart')
local drawings = [Link]

if self:check(client) then
[Link] =
([Link] -
[Link]).Magnitude
end

[Link](function()
local position, visible = camera:WorldToViewportPoint([Link])

local visuals = [Link]

local function check()


local team
if [Link] then team = [Link] ~= [Link] else team =
true end
return [Link] and [Link] and [Link] <=
[Link] and team
end

local function color(color)


if [Link] then
color = [Link]
end
return color
end

if visible and check() then


local scale = 1 / (position.Z * [Link]([Link]([Link] *
0.5)) * 2) * 1000
local width, height = [Link](4.5 * scale), [Link](6 * scale)
local x, y = [Link](position.X), [Link](position.Y)
local xPosition, yPosition = [Link](x - width * 0.5), [Link]((y
- height * 0.5) + (0.5 * scale))

[Link] = [Link](width, height)


[Link] = [Link](xPosition, yPosition)
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]

[Link] = color([Link])
[Link] = 1
[Link] = color([Link])
[Link] = [Link]
[Link] = [Link]
[Link] = 3

[Link] = [Link] - 1
[Link] = [Link] - 1

[Link] = `[ {[Link]} ]`
[Link] = [Link]([Link]([Link](12.5 * scale), 12.5),
10)
[Link] = [Link](x, (yPosition -
[Link].Y) - 2)
[Link] = color([Link])
[Link] = [Link]
[Link] = [Link]

[Link] = [Link] + 1

[Link] = `[ {[Link]([Link])} ]`
[Link] = [Link]([Link]([Link](11 * scale), 11),
10)
[Link] = [Link](x, (yPosition + height) +
([Link].Y * 0.25))
[Link] = color([Link])
[Link] = [Link]
[Link] = [Link]
end

[Link] = (check() and visible and [Link])


[Link] = (check() and [Link] and
[Link])
[Link] = (check() and [Link] and
[Link])
[Link] = (check() and visible and [Link])
[Link] = (check() and visible and
[Link])
end)
end

declare(get("player"), "loop", get("loop"):new(function ()


for character, data in get("player").cache do
get("player"):update(character, data)
end
end), true)
declare(global, "features", {})

[Link] = function(self, feature, boolean)


if self[feature] then
if boolean == nil then
self[feature].enabled = not self[feature].enabled
else
self[feature].enabled = boolean
end

if self[feature].toggle then
[Link](function()
self[feature]:toggle()
end)
end
end
end

declare(features, "visuals", {
["enabled"] = true,
["teamCheck"] = false,
["teamColor"] = true,
["renderDistance"] = 4000,

["boxes"] = {
["enabled"] = true,
["color"] = [Link](255, 255, 255),
["outline"] = {
["enabled"] = true,
["color"] = [Link](0, 0, 0),
},
["filled"] = {
["enabled"] = false,
["color"] = [Link](255, 255, 255),
["transparency"] = 0.25
},
},
["names"] = {
["enabled"] = true,
["color"] = [Link](255, 255, 255),
["outline"] = {
["enabled"] = true,
["color"] = [Link](0, 0, 0),
},
},
["distance"] = {
["enabled"] = true,
["color"] = [Link](255, 255, 255),
["outline"] = {
["enabled"] = true,
["color"] = [Link](0, 0, 0),
},
},
})

for _, player in players:GetPlayers() do


if player ~= client and not get("player"):find(player) then
get("player"):new(player)
end
end

declare(get('player'), 'added', [Link]:Connect(function(player)


if players:FindFirstChild([Link]) then
if not get("player"):find(players[[Link]]) then
get("player"):new(players[[Link]])
end
end
end), true)

declare(get('player'), 'removing', [Link]:Connect(function(player)


if players:FindFirstChild([Link]) then
get("player"):remove(players[[Link]])
end
end), true)

You might also like