Overhead Nametag Help

Hello! Can someone help me with this script? It is not appearing above my head at all. I don’t know what is wrong with it. Here is the way my Nametag is laid out. https://hcpefuls.is-ne.at/5iEapdi8p

Here is my script in Server Script Service.

game.Players.PlayerAdded:Connect(function(player)
local groupid = 11892016

local ServerStorage = game:GetService(“ServerStorage”)
local x = ServerStorage:WaitForChild(“NameTag”)
local billboardui = x:Clone()
local MRicon = billboardui:WaitForChild(“Frame”):WaitForChild(“Badges”):WaitForChild(“HighRank”)
local username = billboardui:WaitForChild(“Frame”):WaitForChild(“PlayerName”)
local rank = billboardui:WaitForChild(“Frame”):WaitForChild(“Rank”)

player.CharacterAdded:Connect(function(Character)
	username.Text = string.upper(player.Name)
	rank.Text = player:GetRoleInGroup(groupid)
	billboardui.Parent = workspace:WaitForChild(player.Name).Head
	
	if player:GetroleInGroup(groupid) >= 246 then
		MRicon.Visible = true
	end
end)

end)

local groupid = 11892016
local ServerStorage = game:GetService("ServerStorage")
local x = ServerStorage:WaitForChild("NameTag")

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(Character)
        local billboardui = x:Clone()
        local MRicon = billboardui:WaitForChild("Frame"):WaitForChild("Badges"):WaitForChild("HighRank")
        local username = billboardui:WaitForChild("Frame"):WaitForChild("PlayerName")
        local rank = billboardui:WaitForChild("Frame"):WaitForChild("Rank")

	    username.Text = string.upper(player.Name)
	    rank.Text = player:GetRoleInGroup(groupid)
    	billboardui.Parent = workspace:WaitForChild(player.Name).Head
	
    	if player:GetRoleInGroup(groupid) >= 246 then
	    	MRicon.Visible = true
	    end
    end)
end)

The only things I really see, is that you put GetroleInGroup instead of GetRoleInGroup() for 1 of your functions (Lua is case-sensitive) & there could be the possible chance that rank.Text could be equal to nil if that player isn’t exactly in the Group so you might wanna check first if they’re in the group before giving them the actual NameTag

Otherwise, do check your Output (Which is located within Studio > View > Output) for errors inside your script :thinking:

It says there is an error in line 8, I updated and fixed what you had told me.

https://hcpefuls.is-ne.at/5iEd39DnE

https://hcpefuls.is-ne.at/5iEdfG0nA

Ah, that explains it

(Just gonna reference it here):

image

Line 8 is this piece of code here:

So what the script is attempting to check for, is an object that’s named HighRank but provided by the image you provided us, it’s still resulting back as a infinite yield as there’s no such thing inside the Frame.Badges Object (Or put simply):

  1. NameTag Object (ServerStorage > NameTag)
  2. The NameTag’s Frame (NameTag > Frame)
  3. The Frame’s Badges (Frame > Badges)
  4. The Badge’s HighRank (Badges > HighRank), which is unable to be found unless named properly

image

I fixed it so that I re-named HighRank to MRicon, but now when I test it out, my nametag and rank do not appear, but the icon does. However the icon looks like this. https://hcpefuls.is-ne.at/5iEeFkMr9

Did you set the Icon of the Staff object, and changed the size of the UI Objects? That’s prob the only think I can think of if you didn’t do that already

Here is my updated script, and my icon is still a square, and all over the place like the screenshot before this reply.

local groupID = 11892016
game.Players.PlayerAdded:Connect(function(player)
local groupRank = player:GetRoleInGroup(groupID)
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = player.Name
clone.Frame.Rank.Text = groupRank
player.CharacterAdded:Connect(function()
local groupRank = player:GetRoleInGroup(groupID)
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = player.Name
clone.Frame.Rank.Text = groupRank
if player:GetRoleInGroup(groupID) >= 246 then
script.Rank.Badges.Staff.Visible = true
script.Badges.Parent = game.Workspace:WaitForChild(player.Name).Head
end
end)
end)