Nametag with tables won't appear in studio

I tried making a customize nametag script using tables for “special” players with “special” nametags. But whenever i join, the nametag won’t appear. The print function did print in output and there was no errors.

Also, please don’t mind the messiness!!

local NameTag = script:WaitForChild("NameTag")
local BadgeService = game:GetService("BadgeService")
local BirthdayGal = 2126383098
local EventPlanner = 2129432981
local Extra = 2126383098

local BirthdayGalID = 541691993 --

local bDayPlanner = {
	541691993, --
	4024257614, --
	264563914, -- 
	2615545338, -- 
	1925498952, --
	1191626539, --
	881378087, --
}


local specialGuest = {
	541691993, 
	4024257614, 
	264563914, 
	2615545338, -- 
	1925498952, --
	1191626539, --
	3304928434, --
	881378087, --
	1187832043, --
	364514244, --
}

special = false
game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local tagClone = NameTag:Clone()
		local Special = tagClone:WaitForChild("F"):WaitForChild("Special")
		local Frame = tagClone:WaitForChild("F")

		local normNameFrameClone = Frame:WaitForChild("NormalUser")
		local normRankFrameClone = Frame:WaitForChild("NormalRank")
		
		local bdyNameFrameClone = Frame:WaitForChild("BdayUser")
		local bdyRankFrameClone = Frame:WaitForChild("BdayRank")
		
		local honoredNameFrameClone = Frame:WaitForChild("HonoredUser")
		local honoredRankFrameClone = Frame:WaitForChild("HonoredRank")
		
		local plannerNameFrameClone = Frame:WaitForChild("PlannerUser")
		local plannerRankFrameClone = Frame:WaitForChild("PlannerRank")


		char:WaitForChild("Humanoid").DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
		
		normNameFrameClone.Text = plr.Name
		bdyNameFrameClone.Text = plr.Name
		honoredNameFrameClone.Text = plr.Name
		plannerNameFrameClone.Text = plr.Name
		

--BadgeService:AwardBadge(plr.UserId, EventPlanner and Extra)
		for i = 1, #bDayPlanner do
			if plr.userId == bDayPlanner[i] then
			Special:WaitForChild("EventPlanner").Visible = true
			Special:WaitForChild("Extras").Visible = true
			bdyNameFrameClone.Visible = true
			plannerRankFrameClone.Visible = true
				special = true
			end
--BadgeService:AwardBadge(plr.UserId, Extra)
			for i = 1, #specialGuest do
				if plr.userId == specialGuest[i] then
				Special:WaitForChild("Extras").Visible = true
				plannerNameFrameClone.Visible = true
				plannerRankFrameClone.Visible = true
				special = true
			end
	if special == false then --check if player is special or not, if special equals false then player will receive the normal nametag
			normNameFrameClone.Visible = true
			normNameFrameClone.Visible = true
				elseif plr.UserId == BirthdayGalID then --check if player is the birthday gal
					--BadgeService:AwardBadge(plr.UserId, BirthdayGal)
			Special:WaitForChild("EventPlanner").Visible = true
			Special:WaitForChild("Extras").Visible = true
			Special:WaitForChild("BirthdayGal").Visible = true
			bdyNameFrameClone.Visible = true
			bdyRankFrameClone.Visible = true
					
			end
		end
	end		
		tagClone.Enabled = true
		tagClone.Parent = char.Head
		tagClone.Adornee = char.Head

		print("yes")
	end)
end)

Here is what it looks like in the explorer:
image

Thank you in advanced!

2 Likes

I am not used to the new icons, what is your NameTag, and F, made of?

1 Like

try using if table.find(urtable, plrvariable.UserId) then

Hopefully this helps with your script!

1 Like

I don’t have them but I’m just going to assume that
NameTag is a ScreenGUI,
F + Special are Frames,
[Blank]Rank + [Blank]User are TextLabels,
and everything under Special are ImageLabels.

The new icons symbolize what they are very well in my opinion.

@pvrechaos If u want me to, I can do an entire revamp on the script.
I am experienced in player permissions with tables.
Its cluttered right now.

The problem was that I had to add a wait() before it adorning the nametag to the head, I had on headless so it wouldn’t appear so it just needed a wait() before parenting or adorning the nametag to the head, I appreciate all of you guy’s help.

Hi! If you are still available to do that, that would help a lot. I can use this script in the near future! :smiley:

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