Hello! I want to make it so that when the player joins, a billboard appears over their head.
However, this isn’t working as the billboard is not parented to the head. I don’t know why this isn’t working and I would greatly appreciate it if someone could help!
Thank you.
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.Size = UDim2.new(0, 200 , 0, 50)
billboard.Name = "FighterGui"
textlabel.Parent = billboard
textlabel.BackgroundTransparency = 1
textlabel.Visible = true
textlabel.Font = Enum.Font.Arcade
textlabel.TextScaled = true
textlabel.Size = UDim2.new(0, 200 , 0, 50)
textlabel.Name = "LabelFighter"
end)
3 Likes
Hmm… that’s odd.
For me, it just doesn’t show up!
what is different between that baseplate project I uploaded and yours?
Nothing. I haven’t done anything to the character
Dose it show up when you run the project I uploaded?
yep! but in my game its just not being added at all to the players head.
Then something is different
Is this because I am using an R15 Character?
I dunno, does it have a Head
at the character root?
Check the model while running:
Instead of creating the entire Billboard using the script, just clone it into the player’s character and set the adornee to their root part.
game:GetService("Player").PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Billboard = script.FighterGui:Clone()
Billboard.Parent = Character
Billboard.Adornee = Character.HumanoidRootPart
end)
end)
2 Likes
This ^ suggestion works too - full code:
game.Players.PlayerAdded:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local billboard = Instance.new("BillboardGui")
local textlabel = Instance.new("TextLabel")
local hrp = plr.Character:WaitForChild("HumanoidRootPart")
billboard.Parent = plr.Character
billboard.Adornee = hrp
billboard.Active = true
billboard.MaxDistance = 30
billboard.ResetOnSpawn = false
billboard.StudsOffset = Vector3.new(0, 4, 0)
billboard.Size = UDim2.new(0, 200 , 0, 50)
billboard.Name = "FighterGui"
textlabel.Parent = billboard
textlabel.BackgroundTransparency = 1
textlabel.Visible = true
textlabel.Font = Enum.Font.Arcade
textlabel.TextScaled = true
textlabel.Size = UDim2.new(0, 200 , 0, 50)
textlabel.Name = "LabelFighter"
textlabel.Text = "Earthraphobic2 it's working"
end)
1 Like
Now the textlabel isn’t in the billboard gui
yah it is - you need to change the StudsOffset
as in my example
1 Like
system
(system)
Closed
October 24, 2023, 8:58pm
#15
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.