So recently, a few groups/experiences, in my experiences as well that are using a custom nametag GUI by using a BillboardGUI. However, some players are experiencing issues where the Billboard GUI was glitched or doesn’t show at all.
local TweenService = game:GetService("TweenService")
local MarketPlaceService = game:GetService("MarketplaceService")
local gamePassId = 10847450
local gamepassid2 = 11286393
local groupId = 7496720
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(char)
local clone = script.Overhead:Clone()
clone.Parent = char.Head
local nameLabel = clone.nameLabel
wait(1)
local prz = TweenService:Create(nameLabel, TweenInfo.new(1,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false,0), {Position = UDim2.new(0,0,0,0)})
prz:Play()
nameLabel.Text = Player.Name
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, gamePassId) then
while true do
local Color = Color3.new(math.random(), math.random(), math.random())
nameLabel.TextStrokeTransparency = 0
local ColorTween = TweenService:Create(nameLabel, TweenInfo.new(3), {TextStrokeColor3 = Color})
ColorTween:Play()
wait(2)
end
end
end)
end)
It was working, 100%, however, it’s no longer working and other groups and experiences are having this issue as well, it probably after the update that is related to the new Roblox’s head mesh issues.
So I’m not sure if you’re getting the glitch that sometimes I have to deal with but for me, sometimes the CharacterAdded function doesn’t seem to want to play when someone first joins the game, you could just make a quick thing to run it a second time just in case it doesn’t show.
Here’s a script that I think might help
local TweenService = game:GetService("TweenService")
local MarketPlaceService = game:GetService("MarketplaceService")
local gamePassId = 10847450
local gamepassid2 = 11286393
local groupId = 7496720
local function CreateTag(Player)
Player.Character:WaitForChild("Head")
if Player.Character.Head:FindFirstChild("Overhead") == nil then
local clone = script.Overhead:Clone()
clone.Parent = Player.Character.Head
local nameLabel = clone.nameLabel
wait(1)
local prz = TweenService:Create(nameLabel, TweenInfo.new(1,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false,0), {Position = UDim2.new(0,0,0,0)})
prz:Play()
nameLabel.Text = Player.Name
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, gamePassId) then
while true do
local Color = Color3.new(math.random(), math.random(), math.random())
InformationLabel.TextStrokeTransparency = 0
local ColorTween = TweenService:Create(InformationLabel, TweenInfo.new(3), {TextStrokeColor3 = Color})
ColorTween:Play()
wait(2)
end
end
end
end
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(char)
CreateTag(Player)
end)
game.Workspace:WaitForChild(Player.Name)
CreateTag(Player)
end)
You aren’t setting the BillboardGui’s Adornee. You should always explicitly set it if you’re looking for a surefire method of having the BillboardGui render over the specified part. Developers should not be relying on the behaviour of BillboardGuis rendering on player heads by only parenting them.
Do you have the feature that changes heads to MeshParts enabled? Another workaround for this can be to use the HumanoidRootPart as your adornee instead since that’s the only part in a rig that’s guaranteed not to change. As for this current code though I would opt for WaitForChild, don’t think the character is guaranteed to be 100% built when CharacterAdded fires as of right now meaning the Head could be missing when you try to index it.
It’s fine if you aren’t using it. I wagered that the engine rebuilt the Head if that feature was enabled much like how it rebuilds the rig to apply bundles. In any case, I would just try and go for a head Adornee.
local RankUI = script.OverheadGui:Clone()
RankUI.Adornee = Character:WaitForChild("Head")
RankUI.Parent = Character
Your console ever error when the Adornee doesn’t read anything?
Commit to debugging then, can’t just copy paste my code. I left an additional note asking if you ever saw any errors in the console with your original code.
Just for reference, I created my own nametag script in a couple of seconds and it’s giving me the exact results I’m expecting. That is, it adorns above my head and adornee isn’t nil.
local Players = game:GetService("Players")
local ServerStorage = game:GetService("ServerStorage")
local function playerAdded(player)
local function characterAdded(character)
local new = ServerStorage.BillboardGui:Clone()
new.Adornee = character:WaitForChild("Head")
new.Parent = character
end
player.CharacterAdded:Connect(characterAdded)
if player.Character then
characterAdded(player.Character)
end
end
Players.PlayerAdded:Connect(playerAdded)
for _, player in ipairs(Players:GetPlayers()) do
playerAdded(player)
end
Frankly sounds like a case of poor code architecture, though your code looks fine as it is (minus the lack of initial state setting) and yet has a problem that shouldn’t be. I advise you to check your console or do some debugging when you run into similar such issues.
Nope, just seems like a case of bad code architecture, the mesh of a Head would not affect the rendering of a BillboardGui. I put that same head on and it renders as intended.