
Key RequiredUniversal

--//Toggle\\--
getgenv().Toggle = true -- This toggles the esp, turning it to false will turn it off
getgenv().TC = false -- This toggles team check, turning it on will turn on team check
local PlayerName = "Name" -- You can decide if you want the Player's name to be a display name which is "DisplayName", or username which is "Name"
--//Variables\\--
local P = game:GetService("Players")
local LP = P.LocalPlayer
--//Debounce\\--
local DB = false
--//Notification\\--
game.StarterGui:SetCore("SendNotification", {
Title = "Notification",
Text = "This Script Was Made By Psygen" ,
Button1 = "Ok",
Button2 = "Shut Up",
Duration = math.huge
})
game.StarterGui:SetCore("SendNotification", {
Title = "Notification",
Text = "Please Subscribe To Psygen On Youtube" ,
Button1 = "Ok",
Button2 = "Shut Up",
Duration = math.huge
})
--//Loop\\--
while task.wait() do
if not getgenv().Toggle then
break
end
if DB then
return
end
DB = true
pcall(function()
for i,v in pairs(P:GetChildren()) do
if v:IsA("Player") then
if v ~= LP then
if v.Character then
local pos = math.floor(((LP.Character:FindFirstChild("HumanoidRootPart")).Position - (v.Character:FindFirstChild("HumanoidRootPart")).Position).magnitude)
-- Credits to Infinite Yield for this part (pos) ^^^^^^
if v.Character:FindFirstChild("Totally NOT Esp") == nil and v.Character:FindFirstChild("Icon") == nil and getgenv().TC == false then
--//ESP-Highlight\\--
local ESP = Instance.new("Highlight", v.Character)
ESP.Name = "Totally NOT Esp"
ESP.Adornee = v.Character
ESP.Archivable = true
ESP.Enabled = true
ESP.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
ESP.FillColor = v.TeamColor.Color
ESP.FillTransparency = 0.5
ESP.OutlineColor = Color3.fromRGB(255, 255, 255)
ESP.OutlineTransparency = 0
--//ESP-Text\\--
local Icon = Instance.new("BillboardGui", v.Character)
local ESPText = Instance.new("TextLabel")
Icon.Name = "Icon"
Icon.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
Icon.Active = true
Icon.AlwaysOnTop = true
Icon.ExtentsOffset = Vector3.new(0, 1, 0)
Icon.LightInfluence = 1.000
Icon.Size = UDim2.new(0, 800, 0, 50)
ESPText.Name = "ESP Text"
ESPText.Parent = Icon
ESPText.BackgroundColor3 = v.TeamColor.Color
ESPText.BackgroundTransparency = 1.000
ESPText.Size = UDim2.new(0, 800, 0, 50)
ESPText.Font = Enum.Font.SciFi
ESPText.Text = v[PlayerName].." | Distance: "..pos
ESPText.TextColor3 = v.TeamColor.Color
ESPText.TextSize = 18.000
ESPText.TextWrapped = true
else
if v.TeamColor ~= LP.TeamColor and v.Character:FindFirstChild("Totally NOT Esp") == nil and v.Character:FindFirstChild("Icon") == nil and getgenv().TC == true then
--//ESP-Highlight\\--
local ESP = Instance.new("Highlight", v.Character)
ESP.Name = "Totally NOT Esp"
ESP.Adornee = v.Character
ESP.Archivable = true
ESP.Enabled = true
ESP.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
ESP.FillColor = v.TeamColor.Color
ESP.FillTransparency = 0.5
ESP.OutlineColor = Color3.fromRGB(255, 255, 255)
ESP.OutlineTransparency = 0
--//ESP-Text\\--
local Icon = Instance.new("BillboardGui", v.Character)
local ESPText = Instance.new("TextLabel")
Icon.Name = "Icon"
Icon.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
Icon.Active = true
Icon.AlwaysOnTop = true
Icon.ExtentsOffset = Vector3.new(0, 1, 0)
Icon.LightInfluence = 1.000
Icon.Size = UDim2.new(0, 800, 0, 50)
ESPText.Name = "ESP Text"
ESPText.Parent = Icon
ESPText.BackgroundColor3 = v.TeamColor.Color
ESPText.BackgroundTransparency = 1.000
ESPText.Size = UDim2.new(0, 800, 0, 50)
ESPText.Font = Enum.Font.SciFi
ESPText.Text = v[PlayerName].." | Distance: "..pos
ESPText.TextColor3 = v.TeamColor.Color
ESPText.TextSize = 18.000
ESPText.TextWrapped = true
else
if not v.Character:FindFirstChild("Totally NOT Esp").FillColor == v.TeamColor.Color and not v.Character:FindFirstChild("Icon").TextColor3 == v.TeamColor.Color then
v.Character:FindFirstChild("Totally NOT Esp").FillColor = v.TeamColor.Color
v.Character:FindFirstChild("Icon").TextColor3 = v.TeamColor.Color
else
if v.Character:FindFirstChild("Totally NOT Esp").Enabled == false and v.Character:FindFirstChild("Icon").Enabled == false then
v.Character:FindFirstChild("Totally NOT Esp").Enabled = true
v.Character:FindFirstChild("Icon").Enabled = true
else
if v.Character:FindFirstChild("Icon") then
v.Character:FindFirstChild("Icon")["ESP Text"].Text = v[PlayerName].." | Distance: "..pos
end
end
end
end
end
end
end
end
end
end)
wait()
DB = false
end



ok
nice script
:135: Expected '(', '{' or <string> when parsing function call, got <eof>
not opmized...