Custom Tags above heads not appearing

Ok so in a game I’m working on we have custom tags to replace the default Roblox name and to show group roles but it won’t add them, no errors just simply won’t add them. It does work for me and only me so I’m really confused.
NEW INFO: The developer tag is the only one that works
Here’s the script:

game.Players.PlayerAdded:Connect(function(plr)
	print("Adding tag to: "..plr.Name)
	local customNameClone = game.ServerStorage.Labels.CustomNameGUI:Clone()
	customNameClone.TextLabel.Text = plr.DisplayName
	plr.CharacterAdded:Connect(function()
		customNameClone.Parent = plr.Character.Head
		if plr:GetRoleInGroup(12434147) == "⭐UGC Creator" then
			local displayClone = game.ServerStorage.Labels.UGC_Creator_Label:Clone()
			displayClone.Parent = plr.Character.Head
		end
		if plr:GetRoleInGroup(12434147) == "🛠 Developer" then
			local displayClone = game.ServerStorage.Labels.Dev_Label:Clone()
			displayClone.Parent = plr.Character.Head
		end
		if plr:GetRankInGroup(12434147) == 255 or plr.UserId == 1421900113 then
			local displayClone = game.ServerStorage.Labels.Founder_Label:Clone()
			displayClone.Parent = plr.Character.Head
		end
		if plr:GetRoleInGroup(12434147) == "👥 Admin" then
			local displayClone = game.ServerStorage.Labels.Admin_Label:Clone()
			displayClone.Parent = plr.Character.Head
		end
		if plr:GetRoleInGroup(12434147) == "🌊Respected" then
			local displayClone = game.ServerStorage.Labels.Respected_Label:Clone()
			displayClone.Parent = plr.Character.Head
		end
		print("Added Successfully to: "..plr.Name)
	end)
end)

A few tips because there isn’t enough information.
use a
:WaitForChild("")
_ because the player needs to load everything. You might just have a really fast pc.
_ so you see, you used plr.Character, but the CharacterAddedEvent gives a character parameter, code:

<
game.Players.PlayerAdded:Connect(function(plr)
	print("Adding tag to: "..plr.Name)
	local customNameClone = game.ServerStorage.Labels.CustomNameGUI:Clone()
	customNameClone.TextLabel.Text = plr.DisplayName
	plr.CharacterAdded:Connect(function(Character)
		customNameClone.Parent = Character.Head
		if plr:GetRoleInGroup(12434147) == "⭐UGC Creator" then
			local displayClone = game.ServerStorage.Labels.UGC_Creator_Label:Clone()
			displayClone.Parent = Character.Head
		end
		if plr:GetRoleInGroup(12434147) == "🛠 Developer" then
			local displayClone = game.ServerStorage.Labels.Dev_Label:Clone()
			displayClone.Parent = Character.Head
		end
		if plr:GetRankInGroup(12434147) == 255 or plr.UserId == 1421900113 then
			local displayClone = game.ServerStorage.Labels.Founder_Label:Clone()
			displayClone.Parent = Character.Head
		end
		if plr:GetRoleInGroup(12434147) == "👥 Admin" then
			local displayClone = game.ServerStorage.Labels.Admin_Label:Clone()
			displayClone.Parent = Character.Head
		end
		if plr:GetRoleInGroup(12434147) == "🌊Respected" then
			local displayClone = game.ServerStorage.Labels.Respected_Label:Clone()
			displayClone.Parent = Character.Head
		end
		print("Added Successfully to: "..plr.Name)
	end)
end)

\___/

oops i need to go illl give more info later, bye, hpoe this helps :happy2:

1 Like

I have returned, ya missed me?.. no :frowning: sign*
anyways,
is it somethign to do with the group ranks? they might not be in the group.
also \it might be because of the emojis. is you say
print(string.len("😀text"))
it would print not 5 but more than that.if you say
orint(uft8.len("😀text"))
it would print5, i don’t know. but it is most likley the cause :happy3:

mistake in the message from eariler

hm, maybe try to removing the emojis or you know what i said earlier.
print(tostring("😀"))
well do that, then take the output text then replce the emoji with it, try not to remove any spaces or add any, example:
"😀text" = "1a2b3ctext" not "1a2b3c text"
hope that helps

its probably something to do with emojis but im unable to find a solution to fix it, sorry
maybe you got your spaces in the name wrong?

I’m going to test the waitforchild, I can’t believe I didn’t think of that.
Also, I replaced the emojis with get rank in group now cause that way it cant ever mess up. Thanks for helping!

1 Like
local players = game:GetService("Players")

local server = game:GetService("ServerStorage")
local labels = server.Labels

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local head = character:WaitForChild("Head")
		local customNameClone = labels.CustomNameGUI:Clone()
		customNameClone.TextLabel.Text = player.DisplayName
		customNameClone.Parent = head
		if player:GetRankInGroup(12434147) == 255 or player.UserId == 1421900113 then
			local displayClone = labels.Founder_Label:Clone()
			displayClone.Parent = head
		elseif player:GetRoleInGroup(12434147):match("Developer$") then
			local displayClone = labels.Dev_Label:Clone()
			displayClone.Parent = head
		elseif player:GetRoleInGroup(12434147):match("UGC Creator$") then
			local displayClone = labels.UGC_Creator_Label:Clone()
			displayClone.Parent = head
		elseif player:GetRoleInGroup(12434147):match("Admin$") then
			local displayClone = labels.Admin_Label:Clone()
			displayClone.Parent = head
		elseif player:GetRoleInGroup(12434147):match("Respected$") then
			local displayClone = labels.Respected_Label:Clone()
			displayClone.Parent = head
		end
	end)
end)

Still wont work, It just doesn’t add the tag, it prints tag added but never adds the tag

Well I removed all of the print commands so nothing should be printed.

If you get an error in console you should share it.

No, I meant in the original script, I tried your’s and it did the same thing

Again, you’re not sharing any error message/details so helping you is nigh impossible.

There are no errors. It simply doesn’t work I had to make it give tags when you move.

I think it has something to do with timing because it doesn’t work unless i make it get added with something other than player added

image

So it’s working for me fine.

local players = game:GetService("Players")

local server = game:GetService("ServerStorage")
local labels = server.Labels

players.PlayerAdded:Connect(function(player)
	player.CharacterAppearanceLoaded:Connect(function(character)
		local head = character:WaitForChild("Head")
		local customNameClone = labels.CustomNameGUI:Clone()
		customNameClone.TextLabel.Text = player.DisplayName
		customNameClone.Parent = head
		customNameClone.Adornee = head
		local displayClone
		if player:GetRankInGroup(12434147) == 255 or player.UserId == 1421900113 then
			displayClone = labels.Founder_Label:Clone()
		elseif player:GetRoleInGroup(12434147):find("Developer") then
			displayClone = labels.Dev_Label:Clone()
		elseif player:GetRoleInGroup(12434147):find("UGC Creator") then
			displayClone = labels.UGC_Creator_Label:Clone()
		elseif player:GetRoleInGroup(12434147):find("Admin") then
			displayClone = labels.Admin_Label:Clone()
		elseif player:GetRoleInGroup(12434147):find("Respected") then
			displayClone = labels.Respected_Label:Clone()
		end
		if displayClone then
			displayClone.Parent = head
			displayClone.Adornee = head
		end
	end)
end)

I wonder if I have game-specific lag?
Can too many connections without disconnecting cause that?

You could try the script I just provided (it’s slightly different from the original one).

is the tag invisible? You say it adds tag but it doesn’t show.

1 Like

I don’t think so cause they work when I add them manually with devconsole

This should go without saying but this is a server script right?

Yes lol. I’m trying your version of the script

repro.rbxm (4.4 KB)

Well I’m not sure what you’re doing wrong but here’s the model file I was working with. It doesn’t have any of the group tags but it has the main one (which I tested with).

It worked! I have no idea why it wasn’t before but it did now! THANK YOU SO MUCH!