Overhead gui script not working

I am trying to make an Overhead GUI but my script does not work it prints OMg it worked or maybe not but does not work

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(Character)
		local clone = game.ReplicatedStorage:WaitForChild("BillboardGui"):Clone()
		clone.Parent = Character.Head
		clone.Adornee = Character.Head
		local InformationLabel = clone.TextLabel
		InformationLabel.Text = player.Name
		print("OMg it worked or mayber not")


	end)
end)


2 Likes

Greetings, first of all may I know which type of script you have used and where it is located?

It’s just a script and it’s located in serverscriptstorage
the billboard gui is located in replicatedstorage

sorry for late reply

check if the gui is enabled and stuff like the transparency etc

yes it’s enabled and the transparency is 0

Be sure to check if everything is enabled or visible. Not just the billboardGui, but the TextLabel as well.

It still does not work sadly…

I’m not too sure then, the script looks fine. The only possible problem is the BillboardGui and related elements.

First off, I love your avatar.

It says that you have requested module was required recursively.
Do you happen to have modules that depend on each other?

For the Billboard issue.
Try switching these two lines around.

clone.Adornee = Character.Head
clone.Parent = Character.Head
2 Likes

So I have a working solution for you. There needs to be some adjustment to the code.
You need to put the billboardGui in your StarterGui. If you want it on your head.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(Character)
		local playerGui = player:WaitForChild( "PlayerGui" );
		local billboardGui = playerGui:WaitForChild( "BillboardGui" );
		
		billboardGui.Adornee = Character:WaitForChild("Head");
		
		local InformationLabel = billboardGui.TextLabel
		InformationLabel.Text = player.Name
		print("OMg it worked or mayber not")
	end)
end)

Let me see what other ways I can do this.

5 Likes

Omg thank you so much it works

If you want your original solution, where your BillBoardGui is inside of your replicated storage.
You can try this.

local RS = game:GetService("ReplicatedStorage");

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(Character)
		local clone = RS:WaitForChild( "BillboardGui" ):Clone( );
		local playerGui = player:WaitForChild( "PlayerGui" );
		
		clone.Parent = playerGui;
		
		wait( );
		clone.Adornee = Character:WaitForChild( "Head" );

		local InformationLabel = clone.TextLabel
		InformationLabel.Text = player.Name
		print("OMg it worked or mayber not")
	end)
end)
4 Likes