local players = game:GetService("Players")
local function createESPForCharacter(character, player)
local highlight = Instance.new("Highlight")
highlight.Parent = character
highlight.Adornee = character
highlight.FillTransparency = 1 -- Fully transparent, only outline visible
-- Set the outline color based on team color
if player.Team then
highlight.OutlineColor = player.Team.TeamColor.Color -- Use the player's
team color
else
highlight.OutlineColor = Color3.new(1, 1, 1) -- Default to white if no team
end
highlight.OutlineTransparency = 0 -- Fully visible outline
end
local function createESP(player)
-- Check if the player has a character
local character = player.Character
if character then
createESPForCharacter(character, player)
end
player.CharacterAdded:Connect(function(character)
createESPForCharacter(character, player)
end)
end
local function setupESP()
-- Create ESP for existing players
for _, player in pairs(players:GetPlayers()) do
createESP(player)
end
-- Create ESP for new players that join
players.PlayerAdded:Connect(function(player)
createESP(player)
end)
end
-- Start ESP
spawn(function()
setupESP()
end)