Nametags wont appear above player head

Hello devforum,
I’ve been trying to create nametags for my game, however to no success, for some reason the install script just wont work, I’ve tried other nametag systems, and tutorials here on the forum, however to no avail.
Here is my current script:

-- Services
local RepStore = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

-- Assets
local Nametag = RepStore:WaitForChild("Nametag")

Players.PlayerAdded:Connect(function(plr)
	local function ActivateTag(character)
		local head = character:WaitForChild("Torso")
		if not head then
			return
		end
		
		local clone = Nametag:Clone()
		local PlrName = plr.Name
		local WorkSpaceChar = game.Workspace:WaitForChild(PlrName)
				
				
				clone.Frame.role.Text = "Civilian"
				clone.Frame.charname.Text = PlrName
				clone.Frame.username.Text = "(@"..PlrName..")"
				clone.Enabled = true
				clone.Frame.Visible = true
				
		clone.Parent = head
		clone.Adornee = head
		print("Nametag Install for player " ..plr.Name.. "sucessful.")
	end
	plr.CharacterAdded:Connect(ActivateTag())
end)

Currently the issue is that for some reason the script cant find the Head of the player to put the tag in, however (from earlier testing) when it manages to put the nametag into the player’s head, the tag just doesn’t show up.
This is very confusing and I’m really out of options, so any help is appreciated in advance.

3 Likes

Is your character R6 or R15? Only R6 characters have a Torso part so that could be the issue. I recommend using HumanoidRootPart as both R6 and R15 characters have that part.

2 Likes

Currently the game is R6 only, however from my testing I’ve already tried the HumanoidRootPart, which sadly didn’t work either.

2 Likes

I put the code into studio and for some reason it can’t access the Nametag in ReplicatedStorage, what happens if you move the Nametag as a child of the script?

Also you need to remove the brackets from ActivateTag on the CharacterAdded line to send the character. It should look like this: plr.CharacterAdded:Connect(ActivateTag)

2 Likes

That works perfectly!
Thanks for helping, and of course I appreciate it.

Congratulations on your 3rd solution!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.