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

Why wont my billboard gui frame show up above my characters head?

I made a billboardgui with a frame in it, the parent is the players head so it will show the players level above them, I know for a fact its not because it is inside my player and hidden because i tested that, I moved it around, it still didnt show, the background transparency is 0, and the visible bool value is set to true. Here is the code i made to create it so far if that helps at all.

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(char)
		local gui = Instance.new("BillboardGui", char.Head)
		local level = player.leaderstats.Level
		local frame = Instance.new("TextLabel", gui)
		frame.Size = UDim2.new(1,0,1,0)
		frame.Position = UDim2.new(0,0,0,0)
	end)
end)

1 answer

✓ Accepted answer

You 1st need to wait for the characters head before adding in the gui, 2nd all you needed to do is set the GUI size.

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(char)
        local gui = Instance.new("BillboardGui", char:WaitForChild('Head')) -- we need to wait for the characters head
		gui.Size = UDim2.new(0,100,0,100) -- set the gui size
		gui.StudsOffset = Vector3.new(0,2,0) -- moves the gui above the players head a bit
		
       local level = player.leaderstats.Level
        local frame = Instance.new("TextLabel", gui)
        frame.Size = UDim2.new(1,0,1,0)
        frame.Position = UDim2.new(0,0,0,0)
    end)
end)

Hope this helps

1 comment

0

ahhh, it works, I did not notice you had to set a size for a billboard gui. Thanks

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