Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make an overhead gui correctly?

Hi, I've recently tried an attempt to make an overhead GUI which did nit go down well cause it has no errors and it's not working properly.

local billboardgui = game:GetService("ServerStorage"):WaitForChild("Billboardgui")

game.Players.PlayerAdded:Connect(function(player)
	
	player.CharacterAdded:Connect(function(character)
 if player.Name == "charlesec" then
local clonedgui = billboardgui:Clone()
clonedgui.TextLabel.Text = "Owner"
clonedgui.TextLabel.TextColor3 = Color3.fromRGB(255, 255, 0)
clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
    
     end


end)

3 comments

0

What is the problem exactly? What doesn't work?

0

It won't put the gui over my avatars head.

0

AlvinBlox made a great tutorial on this. Here's the video: https://www.youtube.com/watch?v=-MsFqGCtn2k

1 answer

✓ Accepted answer

I hope this is what you've been looking for!

local function NewOverheadGui(title, player)
	local BillboardGui = Instance.new("BillboardGui")
	local TextLabel = Instance.new("TextLabel")
	
	BillboardGui.Parent = workspace:WaitForChild(player.Name).Head
	BillboardGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
	BillboardGui.Active = true
	BillboardGui.AlwaysOnTop = true
	BillboardGui.ExtentsOffsetWorldSpace = Vector3.new(0, 5, 0)
	BillboardGui.LightInfluence = 1.000
	BillboardGui.Size = UDim2.new(0, 200, 0, 50)
	
	TextLabel.Parent = BillboardGui
	TextLabel.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
	TextLabel.BackgroundTransparency = 1.000
	TextLabel.Size = UDim2.new(0, 200, 0, 50)
	TextLabel.Font = Enum.Font.SourceSans
	TextLabel.Text = title
	TextLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
	TextLabel.TextSize = 14.000
	
	return BillboardGui
end

game.Players.PlayerAdded:Connect(function(Player)
	
	if Player.Name == "Owner Name" then
		NewOverheadGui("Owner", Player)
	end
	
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.