Overhead Cloning Issue

I’m currently running into an issue with overhead cloning. I’m obviously doing something wrong here and I can’t figure out what the issue is. I’ve gone through multiple steps to try and debug the issue, but nothing is working. I’m getting no errors in output as well.

Code:

-- avoiding_fans

-- Services
local MarketPlaceService = game:GetService("MarketplaceService")
local PlayerService = game:GetService("Players")

-- Variables
local Configuration = {
	["Group Configuration"] = {
		["Group Id"] = 8537612;
		["Bypass Rank"] = 200;
	};
	["Gamepass Configuration"] = {
		["Dreamtimes Gamepass"] = 15563556;
		["Special Golden Nametag"] = 15563845;
	};
	["Color Configuration"] = {
		["Vibe"] = ColorSequence.new(Color3.fromRGB(11, 182, 255), Color3.fromRGB(255, 46, 252));
		--["Rainbow"] = ColorSequence.new(Color3.fromRGB())
		["Fire"] = ColorSequence.new(Color3.fromRGB(255, 0, 0), Color3.fromRGB(255, 118, 26), Color3.fromRGB(255, 0, 0));
		["Snow"] = ColorSequence.new(Color3.fromRGB(119, 233, 255), Color3.fromRGB(64, 214, 255));
		["Energy"] = ColorSequence.new(Color3.fromRGB(96, 255, 96), Color3.fromRGB(65, 214, 255));
		["Emerald"] = ColorSequence.new(Color3.fromRGB(51, 136, 51), Color3.fromRGB(126, 255, 112));
		["Lightning"] = ColorSequence.new(Color3.fromRGB(71, 65, 255), Color3.fromRGB(180, 200, 255))
	}
}

local OverheadTemplate = script:WaitForChild("OverheadTemplate")

-- Code
PlayerService.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function()
		local ClonedOverhead = OverheadTemplate:Clone()
		ClonedOverhead.Parent = Player.Character.Head
		ClonedOverhead.Adornee = Player.Character.Head

		--ClonedOverhead.Main.Level.Text = "0"
		ClonedOverhead.Main.Rank.Text = Player:GetRoleInGroup(Configuration["Group Configuration"]["Group Id"])
		ClonedOverhead.Main.Username.Text = Player.Name
	end)
end)```

Is it not showing at all or is there just something wrong with the group role system, Ill go check it out in the meanwhile

its a server script in Server script storage right

Not showing at all, I’ve also added some print statements to try and debug the issue, all print statements are sent in output and the BillboardGui doesn’t appear at all on my head.

This is a simple fix, just add a Player.Character:WaitForChild("Head") before this line and you’ll be fine
(worked for me lol)

Can you send me a .rbxl file of your billboard GUI?

I’d just use the parameter CharacterAdded provides? Also make sure that there’s a Head variable

Try to debug with print() statements, this should be a script inside ServerScriptService I’d assume:

-- Services
local MarketPlaceService = game:GetService("MarketplaceService")
local PlayerService = game:GetService("Players")

-- Variables
local Configuration = {
	["Group Configuration"] = {
		["Group Id"] = 8537612;
		["Bypass Rank"] = 200;
	};
	["Gamepass Configuration"] = {
		["Dreamtimes Gamepass"] = 15563556;
		["Special Golden Nametag"] = 15563845;
	};
	["Color Configuration"] = {
		["Vibe"] = ColorSequence.new(Color3.fromRGB(11, 182, 255), Color3.fromRGB(255, 46, 252));
		--["Rainbow"] = ColorSequence.new(Color3.fromRGB())
		["Fire"] = ColorSequence.new(Color3.fromRGB(255, 0, 0), Color3.fromRGB(255, 118, 26), Color3.fromRGB(255, 0, 0));
		["Snow"] = ColorSequence.new(Color3.fromRGB(119, 233, 255), Color3.fromRGB(64, 214, 255));
		["Energy"] = ColorSequence.new(Color3.fromRGB(96, 255, 96), Color3.fromRGB(65, 214, 255));
		["Emerald"] = ColorSequence.new(Color3.fromRGB(51, 136, 51), Color3.fromRGB(126, 255, 112));
		["Lightning"] = ColorSequence.new(Color3.fromRGB(71, 65, 255), Color3.fromRGB(180, 200, 255))
	}
}

local OverheadTemplate = script:WaitForChild("OverheadTemplate")

-- Code
PlayerService.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
        print("Character added")

        local Head = Character:WaitForChild("Head")
		local ClonedOverhead = OverheadTemplate:Clone()
		ClonedOverhead.Parent = Head
		ClonedOverhead.Adornee = Head

		--ClonedOverhead.Main.Level.Text = "0"
		ClonedOverhead.Main.Rank.Text = Player:GetRoleInGroup(Configuration["Group Configuration"]["Group Id"])
		ClonedOverhead.Main.Username.Text = Player.Name
        print("Should work?")
	end)
end)

yeah, the head sometimes doesn’t load as soon as character spawns waitforchild is always good practice

OverheadTemplate.rbxm (6.1 KB)

I tried 3 print statements, all of them went through without any errors. I checked my character’s head through explorer while in studio, and didn’t see the BillboardGui as a child of the head.

That’s so extremely odd. It’s appearing to be fully functional for me (and I didn’t even make many changes to the script)

I guess studio is just acting up for me. I’ll see if I can debug some other errors in the game.

1 Like

Tip to future proof your code is to account for initial state which in this case would be a player who joined before PlayerAdded connects or a character spawning before CharacterAdded connects. Although creating a new function per player is a little questionable, I usually write it like this:

local function playerAdded(player)
    local function characterAdded(character)
    end

    player.CharacterAdded:Connect(characterAdded)
    if player.Character then
        characterAdded(character)
    end
end

Players.PlayerAdded:Connect(player)
for _, player in ipairs(Players:GetPlayers()) do
    playerAdded(player)
end
1 Like

Avoiding. Its because you have a headless head. If im right.

Players and people of my games, have also been having issues lately with the OverheadGui cloning over their head.

Its very odd, and I think it has to do with People Avatar’s and such.

All of your code is correct, and should work. Try and add of course -
Player.Character:WaitForChild("Head")

As of what I know its a Roblox Issue for some people its very buggy.

Yep, just figured that out. Some players joined my game for beta testing and everyone had overheads except the people with headless.

Quite strange, never had encountered this issue before though.

1 Like

That’s what I’m saying. People are flipping out on my Youtube Channel saying it doesn’t work while i’m like why the heck did Roblox make an update randomly that changed the “Headless Head” to an actual no head on a player.

Its annoying, because I have no clue how to fix…

Parent your BillboardGuis to the character’s HumanoidRootPart. If you want to control where it appears, parent the BillboardGui to an attachment, then parent the attachment to the HumanoidRootPart and move it up.
@nodoubtjordan you might also be interested in what I said.

1 Like

I think you can fix this by checking if the head mesh is a certain ID (like, the headless head mesh id) and deleting that mesh, but then making the head transparency 1 and the face transparency 1.