local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local function addNameTag(character, playerName)
local head = character:FindFirstChild("Head")
if not head then return end
if head:FindFirstChild("NameTag") then return end
local billboardGui = Instance.new("BillboardGui")
billboardGui.Name = "NameTag"
billboardGui.Adornee = head
billboardGui.Size = UDim2.new(0, 200, 0, 50)
billboardGui.StudsOffset = Vector3.new(0, 2.5, 0)
billboardGui.AlwaysOnTop = true
billboardGui.Parent = head
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.BackgroundTransparency = 1
textLabel.Text = playerName
textLabel.TextColor3 = Color3.new(1, 1, 1)
textLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
textLabel.TextStrokeTransparency = 0
textLabel.TextScaled = true
textLabel.Font = Enum.Font.SourceSansBold
textLabel.Parent = billboardGui
end
local function highlightCharacter(character)
if character:FindFirstChild("Highlight") then return end
local highlight = Instance.new("Highlight")
highlight.FillColor = Color3.fromRGB(144, 238, 144)
highlight.OutlineColor = Color3.new(0, 0, 0)
highlight.Parent = character
end
local function onPlayerAdded(player)
if player == LocalPlayer then return end
local function onCharacterAdded(character)
highlightCharacter(character)
addNameTag(character, player.Name)
end
player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end
end
for _, player in pairs(Players:GetPlayers()) do
onPlayerAdded(player)
end
Players.PlayerAdded:Connect(onPlayerAdded)
Comments
Great SCRIPT!!!!!!!!!
Thank you For 1,066 Views! that means alot to me and thanks to the 2 people that liked it and thank you all for using my script!