
KeylessUniversal

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local function getTeamColor(player)
if player.Team then
return player.Team.TeamColor.Color
end
return Color3.fromRGB(255, 255, 255)
end
local function addOutline(player)
if player == LocalPlayer then
return
end
local function setupCharacter(character)
local oldHighlight = character:FindFirstChild("TeamOutline")
if oldHighlight then
oldHighlight:Destroy()
end
local oldName = character:FindFirstChild("TeamName")
if oldName then
oldName:Destroy()
end
local highlight = Instance.new("Highlight")
highlight.Name = "TeamOutline"
highlight.Adornee = character
highlight.FillTransparency = 1
highlight.OutlineTransparency = 0
highlight.OutlineColor = getTeamColor(player)
highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
highlight.Parent = character
local billboard = Instance.new("BillboardGui")
billboard.Name = "TeamName"
billboard.Adornee = character:WaitForChild("Head", 5)
billboard.Size = UDim2.fromOffset(150, 30)
billboard.StudsOffset = Vector3.new(0, 2.5, 0)
billboard.AlwaysOnTop = true
billboard.Parent = character
local text = Instance.new("TextLabel")
text.Size = UDim2.fromScale(0.5, 0.5)
text.BackgroundTransparency = 1
text.Text = player.DisplayName
text.TextColor3 = getTeamColor(player)
text.TextStrokeTransparency = 0.25
text.TextScaled = true
text.Font = Enum.Font.GothamBold
text.Parent = billboard
end
if player.Character then
setupCharacter(player.Character)
end
player.CharacterAdded:Connect(setupCharacter)
player:GetPropertyChangedSignal("Team"):Connect(function()
if player.Character then
local highlight = player.Character:FindFirstChild("TeamOutline")
local billboard = player.Character:FindFirstChild("TeamName")
if highlight then
highlight.OutlineColor = getTeamColor(player)
end
if billboard then
local text = billboard:FindFirstChildOfClass("TextLabel")
if text then
text.TextColor3 = getTeamColor(player)
end
end
end
end)
end
for _, player in ipairs(Players:GetPlayers()) do
addOutline(player)
end
Players.PlayerAdded:Connect(addOutline)No comments yet for this script.



