Hi, I’m a novice developer developing a storygame, and I have a small issue. The billboard isn’t assigning to the character’s head even though it seems like it’s supposed to work. What am I doing wrong?
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Parent = player
leaderstats.Name = "Leaderstats"
local wins = Instance.new("IntValue")
wins.Value = 0
wins.Name = "Wins"
wins.Parent = leaderstats
end)
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 = 1000
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.TextScaled = true
textlabel.Size = UDim2.new(0, 200 , 0, 50)
textlabel.Name = "LabelFighter"
textlabel.Text = "Traveler"
textlabel.Font = Enum.Font.Ubuntu
textlabel.TextColor3 = Color3.new(0.1, 0.8, 0.38)
textlabel.RichText = true
if plr.Leaderstats.Wins.Value >= 5 then
textlabel.Text = "Explorer"
textlabel.TextColor3 = Color3.new(0.38, 0.8, 0.8)end
if plr.Leaderstats.Wins.Value >= 15 then
textlabel.Text = "Tourist"
textlabel.TextColor3 = Color3.new(0.1, 0.1, 0.8)end
if plr.Leaderstats.Wins.Value >= 25 then
textlabel.Text = "Tour Guide"
textlabel.TextColor3 = Color3.new(0.7, 0, 0.7)end
if plr.Leaderstats.Wins.Value >= 35 then
textlabel.Text = "Flight Attendant"
textlabel.TextColor3 = Color3.new(0.3, 0, 0.3)end
if plr.Leaderstats.Wins.Value >= 50 then
textlabel.Text = "Expert Explorer"
textlabel.TextColor3 = Color3.new(0.9, 0.86, 0)end
if plr.Leaderstats.Wins.Value >= 65 then
textlabel.Text = "Business Traveler"
textlabel.TextColor3 = Color3.new(1, 0.66, 0)end
end)