Text not getting on head

I’ve made a gui that’s on top of your head when you join obviously, but it just won’t go on the head, I’ve tried to just do it on the character itself, It worked absolutely fine, but it doesn’t work on the head… How can I fix that? Thank you for reading

local players = game:GetService("Players")
players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(Char)
		local BG = script.BillboardGui:Clone()
		BG.Parent = Char.Head
		BG.TextLabel.Text = Char.Name.." - "..plr.leaderstats.Rank.Value
	end)
end)

You’re going to want to set the Adornee property of the BillboardGui to the character’s head as well.

I’ve tried it, It won’t work

local players = game:GetService("Players")
players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(Char)
		local BG = script.BillboardGui:Clone()
		BG.Parent = Char:FindFirstChild("Head")
		BG.Adornee = Char:FindFirstChild("Head")
		BG.TextLabel.Text = Char.Name.." - "..plr.leaderstats.Rank.Value
	end)
end)

Try using :WaitForChild(); the GUI might not have loaded in.

Still doesn’t work

local players = game:GetService("Players")
players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(Char)
		local BG = script:WaitForChild("BillboardGui")
		BG.Parent = Char:FindFirstChild("Head")
		BG.Adornee = Char:FindFirstChild("Head")
		BG.TextLabel.Text = Char.Name.." - "..plr.leaderstats.Rank.Value
	end)
end)

Use :WaitForChild() on the head as well and remove the adornee.

Still doesn’t work.

local players = game:GetService("Players")
players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(Char)
		local BG = script:WaitForChild("BillboardGui"):Clone()
		BG.Parent = Char:WaitForChild("Head")
		BG.TextLabel.Text = Char.Name.." - "..plr.leaderstats.Rank.Value
	end)
end)

but keep in mind, whenever I parent it to the character itself, it works.

local players = game:GetService("Players")

players.PlayerAdded:Connect(function(plr)
	plr.CharacterAppearanceLoaded:Connect(function(Char)
		print("Character loaded.")
		local BG = script.BillboardGui:Clone()
		print("Cloned GUI")
		BG.Parent = Char:WaitForChild("Head")
		print("Parented to head!")
		
		BG.TextLabel.Text = Char.Name.." - "..plr:WaitForChild("leaderstats").Rank.Value
	end)
end)

Try this script, if it doesn’t work I believe it may be an issue with the tag itself. Be sure to let me know if one of the print statements fail.

1 Like

It worked, I don’t know what’s wrong with my other script but it works! thanks!

1 Like

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