0% found this document useful (0 votes)
204 views9 pages

ESP Team Script Configuration

The document outlines a script for an ESP (Extra Sensory Perception) system in a game, detailing global settings for various visual elements such as boxes, health bars, head circles, tracers, and skeletons. It includes functions to create, update, and manage these visual elements based on player status and visibility while incorporating team checks. The script also handles player removal and character addition to ensure the ESP system functions correctly for all players in the game environment.

Uploaded by

xqwcvz
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)
204 views9 pages

ESP Team Script Configuration

The document outlines a script for an ESP (Extra Sensory Perception) system in a game, detailing global settings for various visual elements such as boxes, health bars, head circles, tracers, and skeletons. It includes functions to create, update, and manage these visual elements based on player status and visibility while incorporating team checks. The script also handles player removal and character addition to ensure the ESP system functions correctly for all players in the game environment.

Uploaded by

xqwcvz
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

-- Global Settings (_G.

settings)
_G.settings = {
ESPEnabled = true, -- Toggle for ESP
TeamCheck = true, -- Toggle for team check
BoxESP = {
Enabled = true, -- Status to show if box ESP will be visible
ColorVisible = [Link](1, 1, 1), -- Green when visible
ColorNotVisible = [Link](1, 0, 0), -- Red when not visible
Transparency = 0.65, -- Transparency level (0 is opaque, 1 is transparent)
ShowOutline = true, -- Toggle for box outline
Width = 2, -- Width of the box outline
},
HeadCircle = {
Enabled = true, -- Toggle for head circle
Color = [Link](1, 1, 1), -- White color for head circle
Transparency = 0.5, -- Transparency level (0 is opaque, 1 is transparent)
Filled = false, -- Whether the circle should be filled
Radius = 455, -- Fixed radius of the circle
},
Tracer = {
Enabled = true, -- Toggle for tracers
ColorVisible = [Link](0, 1, 0), -- Green when visible
ColorNotVisible = [Link](1, 0, 0), -- Red when not visible
Transparency = 0.7, -- Transparency level (0 is opaque, 1 is transparent)
Thickness = 1, -- Thickness of the tracer line
TargetPoint = "Head", -- Target point for the tracer ("Head" or "RootPart")
},
HealthBar = {
Enabled = true, -- Toggle for health bar
DisplayText = false, -- Toggle for displaying health text
ColorHigh = [Link](0, 1, 0), -- Green color for high health
ColorLow = [Link](1, 0, 0), -- Red color for low health
Transparency = 0.6, -- Transparency level (0 is opaque, 1 is transparent)
Thickness = 2, -- Thickness of the health bar
Width = 4, -- Width of the health bar
OffsetX = -5, -- Offset from the right edge of the box
OffsetY = 0, -- Offset vertically
TextSize = 13, -- Font size of the health in text
},
SkeletonESP = {
Enabled = true, -- Toggle for skeleton ESP
Color = [Link](1, 1, 1), -- White color for skeleton lines
Transparency = 0.5, -- Transparency level (0 is opaque, 1 is transparent)
Thickness = 1, -- Thickness of the skeleton lines
},
}

-- Services
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

-- Variables
local localPlayer = [Link]
local camera = [Link]

-- Tables to store Drawings


local espBoxes = {}
local headCircles = {}
local tracers = {}
local healthBars = {}
local healthTexts = {}
local skeletonLines = {}

-- Function to create a new ESP box, health bar, and head circle
local function createESPBox()
local box = [Link]("Square")
[Link] = false
[Link] = _G.[Link]
[Link] = _G.[Link] and _G.[Link] or
0
[Link] = _G.[Link]

-- Health Bar
local healthBar = [Link]("Line")
[Link] = false
[Link] = _G.[Link]
[Link] = _G.[Link]
[Link] = _G.[Link]

-- Health Text
local healthText = [Link]("Text")
[Link] = false
[Link] = _G.[Link]
[Link] = true
[Link] = true
[Link] = [Link](0, 0, 0)
[Link] = 0.7

return box, healthBar, healthText


end

-- Function to create a new head circle


local function createHeadCircle()
local circle = [Link]("Circle")
[Link] = false
[Link] = _G.[Link]
[Link] = _G.[Link]
[Link] = _G.[Link]
[Link] = _G.[Link]
return circle
end

-- Function to create a new tracer


local function createTracer()
local tracer = [Link]("Line")
[Link] = false
[Link] = _G.[Link]
[Link] = _G.[Link]
return tracer
end

-- Function to create a new skeleton line


local function createSkeletonLine()
local line = [Link]("Line")
[Link] = false
[Link] = _G.[Link]
[Link] = _G.[Link]
[Link] = _G.[Link]
return line
end

-- Function to update ESP boxes, health bars, head circles, and health text
local function updateESP()
for player, box in pairs(espBoxes) do
local healthBar = healthBars[player]
local healthText = healthTexts[player]
if [Link] and [Link]:FindFirstChild("HumanoidRootPart")
then
local char = [Link]
local rootPart = [Link]
local head = char:FindFirstChild("Head")

if rootPart and head then


-- Update Box
local screenPos, onScreen =
camera:WorldToViewportPoint([Link])
if onScreen then
-- Team Check
if _G.[Link] and [Link] == [Link]
then
[Link] = false
[Link] = false
[Link] = false
else
-- Calculate Box Size and Position
local headPos = camera:WorldToViewportPoint([Link] +
[Link](0, 0.5, 0))
local legPos =
camera:WorldToViewportPoint([Link] - [Link](0, 3, 0))
local boxHeight = (headPos - legPos).Y
local boxWidth = boxHeight / 2
[Link] = [Link](boxWidth, boxHeight)
[Link] = [Link](screenPos.X - boxWidth / 2,
screenPos.Y - boxHeight / 2)
[Link] = _G.[Link] and
_G.[Link]

-- Check Visibility
local ray = [Link]([Link],
([Link] - [Link]).Unit * 5000)
local part = workspace:FindPartOnRayWithIgnoreList(ray,
{[Link], [Link]})
if part and part:IsDescendantOf(char) then
[Link] = _G.[Link]
else
[Link] = _G.[Link]
end

-- Update Health Bar


if _G.[Link] then
local humanoid = char:FindFirstChildOfClass("Humanoid")
if humanoid and [Link] > 0 then
local maxHealth = [Link]
local currentHealth = [Link]
local healthPercentage = currentHealth / maxHealth

local barHeight = [Link].Y * healthPercentage


[Link] = [Link]([Link].X +
[Link].X + _G.[Link], [Link].Y + [Link].Y / 2 -
barHeight / 2 + _G.[Link])
[Link] = [Link]([Link].X,
[Link].Y + [Link].Y / 2 + barHeight / 2 + _G.[Link])

-- Adjust color based on health


local lerpedColor =
_G.[Link]:Lerp(_G.[Link],
healthPercentage)
[Link] = lerpedColor

[Link] = _G.[Link] and


(_G.[Link] or _G.[Link])

-- Update Health Text


if _G.[Link] then
local healthPercent =
[Link](healthPercentage * 100)
[Link] = healthPercent .. "%"
[Link] =
[Link]([Link].X + _G.[Link] / 2,
[Link].Y)
[Link] = lerpedColor
[Link] = _G.[Link] and
(_G.[Link] or _G.[Link])
else
[Link] = false
end
else
[Link] = false
[Link] = false
end
else
[Link] = false
[Link] = false
end
end
else
[Link] = false
[Link] = false
[Link] = false
end
else
[Link] = false
[Link] = false
[Link] = false
end
else
[Link] = false
[Link] = false
[Link] = false
end
end
end

-- Function to update head circles


local function updateHeadCircles()
for player, circle in pairs(headCircles) do
if [Link] and [Link]:FindFirstChild("Humanoid") then
local humanoid = [Link]
local head = [Link]:FindFirstChild("Head")

if [Link] > 0 and head then


local headPos = [Link]
local screenPos, onScreen = camera:WorldToViewportPoint(headPos)

if onScreen then
-- Team Check
if _G.[Link] and [Link] == [Link]
then
[Link] = false
else
[Link] = [Link](screenPos.X, screenPos.Y)
[Link] = _G.[Link] / (headPos -
[Link]).Magnitude -- Adjust radius based on distance
[Link] = _G.[Link] and
_G.[Link]
end
else
[Link] = false
end
else
-- Remove head circle if player is dead or health is zero
[Link] = false
headCircles[player] = nil
end
else
[Link] = false
end
end
end

-- Function to update tracers


local function updateTracers()
for player, tracer in pairs(tracers) do
if [Link] and [Link]:FindFirstChild("HumanoidRootPart")
then
local targetPart = _G.[Link] == "Head" and
[Link] or [Link]
local screenPos, onScreen =
camera:WorldToViewportPoint([Link])

if onScreen then
-- Team Check
if _G.[Link] and [Link] == [Link] then
[Link] = false
else
[Link] = [Link]([Link].X / 2, 0) -- Top
center of the screen
[Link] = [Link](screenPos.X, screenPos.Y)

-- Check Visibility
local ray = [Link]([Link],
([Link] - [Link]).Unit * 5000)
local part = workspace:FindPartOnRayWithIgnoreList(ray,
{[Link], [Link]})
if part and part:IsDescendantOf([Link]) then
[Link] = _G.[Link]
else
[Link] = _G.[Link]
end

[Link] = _G.[Link] and


_G.[Link]
end
else
[Link] = false
end
else
[Link] = false
end
end
end

-- Function to update skeleton lines


local function updateSkeleton()
for player, lines in pairs(skeletonLines) do
if [Link] then
local humanoid = [Link]:FindFirstChildOfClass("Humanoid")
if humanoid and [Link] > 0 then
local head = [Link]:FindFirstChild("Head")
local torso = [Link]:FindFirstChild("HumanoidRootPart")
local leftArm = [Link]:FindFirstChild("Left Arm")
local rightArm = [Link]:FindFirstChild("Right Arm")
local leftLeg = [Link]:FindFirstChild("Left Leg")
local rightLeg = [Link]:FindFirstChild("Right Leg")

if head and torso and leftArm and rightArm and leftLeg and rightLeg
then
local headPos = camera:WorldToViewportPoint([Link])
local torsoPos = camera:WorldToViewportPoint([Link])
local leftArmPos =
camera:WorldToViewportPoint([Link])
local rightArmPos =
camera:WorldToViewportPoint([Link])
local leftLegPos =
camera:WorldToViewportPoint([Link])
local rightLegPos =
camera:WorldToViewportPoint([Link])

-- Check if character is on screen


local characterOnScreen = headPos.Z > 0 and torsoPos.Z > 0 and
leftArmPos.Z > 0
and rightArmPos.Z > 0 and leftLegPos.Z > 0 and
rightLegPos.Z > 0

-- Team Check
if _G.[Link] and [Link] == [Link]
then
characterOnScreen = false
end

-- Update skeleton lines


if characterOnScreen then
[Link] = [Link](headPos.X, headPos.Y)
[Link] = [Link](torsoPos.X, torsoPos.Y)
[Link] = [Link](torsoPos.X,
torsoPos.Y)
[Link] = [Link](leftArmPos.X,
leftArmPos.Y)
[Link] = [Link](torsoPos.X,
torsoPos.Y)
[Link] = [Link](rightArmPos.X,
rightArmPos.Y)
[Link] = [Link](torsoPos.X,
torsoPos.Y)
[Link] = [Link](leftLegPos.X,
leftLegPos.Y)
[Link] = [Link](torsoPos.X,
torsoPos.Y)
[Link] = [Link](rightLegPos.X,
rightLegPos.Y)

for _, line in pairs(lines) do


[Link] = _G.[Link] and
_G.[Link]
end
else
for _, line in pairs(lines) do
[Link] = false
end
end
else
for _, line in pairs(lines) do
[Link] = false
end
skeletonLines[player] = nil
end
else
for _, line in pairs(lines) do
[Link] = false
end
skeletonLines[player] = nil
end
else
for _, line in pairs(lines) do
[Link] = false
end
skeletonLines[player] = nil
end
end
end

-- Function to handle player removal


local function onPlayerRemoving(player)
if espBoxes[player] then
espBoxes[player]:Remove()
espBoxes[player] = nil
end
if headCircles[player] then
headCircles[player]:Remove()
headCircles[player] = nil
end
if tracers[player] then
tracers[player]:Remove()
tracers[player] = nil
end
if healthBars[player] then
healthBars[player]:Remove()
healthBars[player] = nil
end
if healthTexts[player] then
healthTexts[player]:Remove()
healthTexts[player] = nil
end
if skeletonLines[player] then
for _, line in pairs(skeletonLines[player]) do
line:Remove()
end
skeletonLines[player] = nil
end
end

-- Function to handle character added


local function onCharacterAdded(player)
if not espBoxes[player] then
espBoxes[player], healthBars[player], healthTexts[player] = createESPBox()
end
if not headCircles[player] then
headCircles[player] = createHeadCircle()
end
if not tracers[player] then
tracers[player] = createTracer()
end
if not skeletonLines[player] then
skeletonLines[player] = {
HeadToTorso = createSkeletonLine(),
TorsoToLeftArm = createSkeletonLine(),
TorsoToRightArm = createSkeletonLine(),
TorsoToLeftLeg = createSkeletonLine(),
TorsoToRightLeg = createSkeletonLine(),
}
end
end

-- Function to handle new player


local function onPlayerAdded(player)
[Link]:Connect(function()
onCharacterAdded(player)
end)
[Link]:Connect(function()
onPlayerRemoving(player)
end)
if [Link] then
onCharacterAdded(player)
end
end

-- Connect events
[Link]:Connect(onPlayerAdded)
[Link]:Connect(onPlayerRemoving)

-- Initial setup for current players


for _, player in pairs(Players:GetPlayers()) do
if player ~= localPlayer then
onPlayerAdded(player)
end
end

-- Update ESP, Head Circles, Health Bars, Skeleton Lines, and Tracers on
RenderStepped
[Link]:Connect(function()
updateESP()
updateHeadCircles()
updateSkeleton()
updateTracers()
end)

-- Clean up drawings when a player dies


[Link]:Connect(function(player)
[Link]:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
onPlayerRemoving(player)
end)
end)
end)

-- Clean up drawings when a player leaves


[Link]:Connect(onPlayerRemoving)

You might also like