Why is it not instance.new()?

hello! im making it so that when the player joins, they have a billboard over their head, and its parented to the “Head” in character.

However, this isn’t working, there are no errors in the output and its messing with all of my other scripts…

I don’t know why this is happening, can someone help!

game.Players.PlayerAdded:Connect(function(plr)
	local char = plr.Character or plr.CharacterAdded:Wait()
	local billboard = Instance.new("BillboardGui")
	local textlabel = Instance.new("TextLabel")
	
	billboard.Parent = char:FindFirstChild("Head")
	billboard.Active = true
	billboard.MaxDistance = 30
	billboard.ResetOnSpawn = false
	billboard.StudsOffset = Vector3.new(0, 2, 0)
	billboard.Name = "FighterGui"

	textlabel.Parent = billboard
	textlabel.BackgroundTransparency = 1
	textlabel.Visible = true
	textlabel.Font = Enum.Font.Arcade
	textlabel.TextScaled = true
	textlabel.Name = "LabelFighter"
end)

When using Instance.new() to create BIllboardGuis and TextLabels, their default size is {0,0,0,0}. Since they have zero size, they are invisible.

I would recommend making the gui in studio, and then using the script to clone it to the character. It’s easier to test how the gui looks because you don’t have to play the game to see it, and it will be easier to edit.

2 Likes

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