Nametag won't parent itself to character

Hello! My nametag script won’t parent itself to the characters head. It printed every line just fine. I am really confused.

Code
local function CharacterAdded(Character)
		Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
		local newNametag = Nametag:Clone()
		newNametag.PlayerName.Text = Player.Name
		newNametag.Parent = Character.Head
	end

I have never had this happen before.

For future reference please provide the full code, because it could be an issue somewhere else other than where the output states.

My guess is that you aren’t grabbing the Character. That is the only possibility I can find with the provided code.

1 Like

Did you set the POS for it? aa

If you are trying to get the script to parent itself to every player, you can utilize the StarterPlayerCharacter folder in the Explorer. It will clone anything in there to the Character Model.

1 Like

I really don’t need to because its all there.
But if you need it, here.

Code
local Players = game:GetService("Players")
local BadgeService = game:GetService("BadgeService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Doors = game:GetService("Workspace"):WaitForChild("BadgeDoors")

local BadgeDoor = ReplicatedStorage:WaitForChild("BadgeDoor")
local Nametag = ReplicatedStorage:WaitForChild("Nametag")

local Badges = {
	["Piggy"] = 2125212328,
}

function PlayerAdded(Player)
	local function CharacterAdded(Character)
		Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
		local newNametag = Nametag:Clone()
		newNametag.PlayerName.Text = Player.Name
		newNametag.Parent = Player.Character.Head
	end
	
	Player.CharacterAdded:Connect(CharacterAdded)
	
	for i,v in pairs(Badges) do
		if BadgeService:UserHasBadgeAsync(Player.UserId, v) then
			BadgeDoor:FireClient(Player, Doors:FindFirstChild(i.."Model"):FindFirstChild(i.."Door"))
		end
	end
end

Players.PlayerAdded:Connect(PlayerAdded)

Thanks!

Did you set the adornment? This could be the problem.

Just did.

local function CharacterAdded(Character)
		Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
		local newNametag = Nametag:Clone()
		newNametag.PlayerName.Text = Player.Name
		newNametag.Adornee = Player.Character.Head
		newNametag.Parent = Player.Character.Head
	end

Nothing changed.

1 Like

Just fixed the issue.
It wasn’t working because of the game avatar settings. If you click on ‘full classic’, it will customize your head.
image
Thanks for trying.

2 Likes
if not player:HasAppearanceLoaded() then
	player.CharacterAppearanceLoaded:Wait()
end
2 Likes