NameTag above character is set to default NameTag until you reset

Basically there’s an issue where the NameTag above someone’s avatar is set to the default which is Megaificent. Let’s say you’re not me, and your name was Cool123. When you join it would say Megaificent instead of Cool123 until you died. Here’s the script:

local rep = game:GetService("ReplicatedStorage")
local nametag = rep.NameTag

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		local head = char.Head
		local newtext = nametag:Clone()
		local uppertext = nametag.UpperText
		
		newtext.Parent = head
		newtext.Adornee = head
		uppertext.Text = player.Name
	end)
end)

you should say char:WaitForChild("Head") so that it actually gets the head. Tell me if that works!

A;so I would really appreciate it if you could help me here: How To Save a Folder to DataStoreService - #9 by CoderHusk

2 Likes

They said “player.CharacterAdded” so I don’t think that’s the issue.

1 Like

I’m not the best with datastores and nope still not working.

Are there any errors in your output? If so, post them here so I can take a look.

I don’t think there would be any errors, everything works it’s just not parenting the NameTag to the head when you join. (It is but it’s not the correct username)

Maybe you should put a wait() after the CharacterAdded function.

1 Like

Also even if you don’t think that there will be any errors you should check.

1 Like

I checked, there’s nothing there.

Nope, that didn’t work sadly…

Can we see what’s in Replicated Storage?

After all those tries I don’t think It’s something in this script really, are you sure It’s not parenting the nametag? Try manually inserting it to the player’s head while in-game so you see if It works.

I don’t really know then. My best workaround is to kill the player immedeately when they spawn. Also maybe set the default value to nothing.

I don’t think people understand the issue, so let me reiterate. (This is a custom NameTag) Pretend there was a guy named Cool123, he joins the game and the NameTag above his head is Megaificent because that’s the default one I put temporarily. But once you reset, it switches to the appropriate username corresponding to the person. (Cool123)

I am pretty sure CharacterAdded only fires after the person has died.

1 Like

That’s not true, when joining a game your avatar needs to load and it works fine on some of my gamepass scripts. It’s true that it does fire after the player dies though.

I don’t think that is it to be honest. Look at my recent post.

Then I guess the NameTag text changing should be looped, or fired from a RemoteEvent.

1 Like

Once again,
My best workaround is to kill the player immedeately when they spawn. Also maybe set the default value to nothing.

Hopefully this works, thanks!

Wouldn’t it make the nametag go away since he wants it to go away on death? (if I read that correctly lol)