Hello DevForum!
I am trying to make a script that clones a Billboard GUI onto player heads whenever someone joins the game, but whenever I test it in Studio, the GUI doesn’t show up and there are no errors appearing in the output bar. What am I doing wrong?
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local UsernamerClone = script.Usernamer:Clone()
UsernamerClone.Parent = Character.Head
local InformationLabel1 = UsernamerClone.InformationLabel
InformationLabel1.Text = Player.Name
end)
end)
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local ABC = script.PickGroup:Clone()
ABC.Parent = Character.Head
local GroupLabel_Child = ABC.GroupLabel_Child
local GroupNumber = math.random(1,3)
if GroupNumber == 1 then
GroupLabel_Child.Text = "Group A"
elseif GroupNumber == 2 then
GroupLabel_Child.Text = "Group B"
elseif GroupNumber == 3 then
GroupLabel_Child.Text = "Group C"
end
end)
end)
2 Likes
You need to set the Adornee
property of the Billboard GUI.
Add this after cloning the Billboard GUI to the player’s head:
UsernamerClone.Adornee = Character.Head
Hey! Thanks for the suggestion. I have just now come to the realization that, sometime over the last 3 weeks, Billboard GUIs aren’t working on heads besides the basic roblox head. I switched from the woman head to the basic head and, voila, the GUI showed up perfectly fine!
It seems to be a recent bug but I haven’t seen anyone bring it up in #bug-reports except for this one post (Nametag wont appear on users with different heads - #11 by stratolog).
Well, they do show up, it just takes different settings within the scripting.
Would you be able to elaborate?
I have made my own and it still would work.
Hm, interesting! And you did this today?
Mhm, I have done this many times, I have even gotten it to change with a GUI textbox.
Yes, I have also gotten it to work many times before. But I have just noticed the issue today, which leads me to believe there is some sort of bug.
Well, it might actually be a new bug. For example my head ig normally looks like this:
But if you check in the other picture, it has changed the formation of the head.
Ive had this problem before as well. However i did find a solution to the problem, by finding the player character’s head in a different way. Try this script below:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
local UsernamerClone = script.Usernamer:Clone()
UsernamerClone.Parent = game.Workspace:WaitForChild(plr.Name).Head
-- getting the character's head from workspace
local InfoLabel1 = UsernamerClone.InformationLabel
InfoLabel1.Text = plr.Name
end)
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
local ABC = script.PickGroup:Clone()
ABC.Parent = game.Workspace:WaitForChild(plr.Name).Head
local GroupLabel_Child = ABC.GroupLabel_Child
local GroupNumber = math.random(1,3)
if GroupNumber == 1 then
GroupLabel_Child.Text = "Group A"
elseif GroupNumber == 2 then
GroupLabel_Child.Text = "Group B"
elseif GroupNumber == 3 then
GroupLabel_Child.Text = "Group C"
end
end)
end)
I tested out your way of finding a player head and it still doesn’t seem to work for me. Though, I really appreciate you trying to help solve the problem!
Any errors in the output or just blank?
Yea, it wasn’t adorneed and I tried both methods but the GUI still only shows up with the basic head, sadly.
Just blank, which is the frustrating part .
1 Like
Try putting the billboard guis in a folder in ReplicatedStorage. Name the folder OverheadGuis. Make a different script in ServerScriptService and disable the other script (just in case this doesnt work). In your new script, use this code:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Folder = ReplicatedStorage:WaitForChild("OverheadGuis")
local UsernamerClone = Folder.Usernamer:Clone()
local ABC = Folder.PickGroup:Clone()
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
UsernamerClone.Parent = game.Workspace:WaitForChild(plr.Name).Head
local InfoLabel1 = UsernamerClone.InformationLabel
InfoLabel1.Text = plr.Name
ABC.Parent = game.Workspace:WaitForChild(plr.Name).Head
local GroupLabel_Child = ABC.GroupLabel_Child
local GroupNumber = math.random(1,3)
if GroupNumber == 1 then
GroupLabel_Child.Text = "Group A"
elseif GroupNumber == 2 then
GroupLabel_Child.Text = "Group B"
elseif GroupNumber == 3 then
GroupLabel_Child.Text = "Group C"
end
end)
end)
Trying that and still nothing . I test the game and the part’s don’t even seem to be children of the head
Strange. Just to clarify, have you put the script inside of ServerScriptService, and are the BillboardGuis in the folder named OverheadGuis, which is in ReplicatedStorage (and is there any errors or warnings in the output)?
Try printing messages in specific areas of the script (like before and after parenting the billboard guis), see if they would even print the messages in the output
2 Likes