Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is the nametag only displaying for some players?

Asked by 3 years ago

The line char.Head only seems to work for roblox default heads. How do I fix this to work for all heads?

--Variables
local rep = game:GetService("ReplicatedStorage") --You can change this to ServerStorage for more security.
local nametag = rep.NameTag 
local r = 255
local g = 0
local b = 0

--Functions
game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)
        --Varibles
        local head = char.Head
        local newtext = nametag:Clone() --Cloning the text.
        local uppertext = newtext.UpperText
        local lowertext = newtext.LowerText
        local humanoid = char.Humanoid

        humanoid.DisplayDistanceType = "None"

        --Main Text default
        newtext.Parent = humanoid
        newtext.Adornee = humanoid
        uppertext.Text = player.Name --Changes the text to the player's name.

Answer this question