lplayer = game.Players.LocalPlayer
Players = game:GetService("Players")
Head = lplayer.Character.Head
bb = script.Parent
bbt = bb.TextLabel
function OnPlayerAdded(plr)
bb.StudsOffset = Vector3.new(0,2,0)
bbt.BackgroundTransparency = 1
bbt.Position = UDim2.new(0,0,.5,0)
bbt.Font = "Legacy"
bbt.FontSize = "Size18"
bbt.TextWrapped = true
bbt.TextColor3 = Color3.new(math.random(1,255)/255,math.random(1,255)/255,math.random(1,255)/255)
bbt.Text = plr.Name
bb.Parent = Head
end
for _,v in pairs(Players:GetPlayers()) do
OnPlayerAdded(v)
end
game.Players.PlayerAdded:connect(OnPlayerAdded)
Whenever I start a server with 2+ players it only gives it to 1 or none of the 2 players, any ideas on why that's happening?
**** EDIT ****
Players = game:GetService("Players")
bbg = game.ReplicatedStorage.bbg -- Replace with correct path, of course
function OnPlayerAdded(plr)
plr.CharacterAdded:connect(function(character)
repeat wait() until plr.Character and plr.Character.HumanoidRootPart
local Head = plr.Character.Head
if Head:FindFirstChild("bbg") then
return
else
wait(1)
local bb = bbg:Clone()
local bbt = bb.TextLabel
bb.StudsOffset = Vector3.new(0,2,0)
bb.Size = UDim2.new(8,0,1,0)
bbt.BackgroundTransparency = 1
bbt.Position = UDim2.new(0,0,.5,0)
bbt.Font = "Legacy"
bbt.FontSize = "Size18"
bbt.TextWrapped = true
bbt.TextColor3 = Color3.new(math.random(1,255)/255,math.random(1,255)/255,math.random(1,255)/255)
wait()
bbt.Text = plr.Name
bb.Parent = Head
end
end
)
for _,v in pairs(Players:GetPlayers()) do
wait()
OnPlayerAdded(v)
end
end
game.Players.PlayerAdded:connect(OnPlayerAdded)

6 comments
Also, you may want to put this in a server script, and put the billboardgui in one of the storages (and change line 7 to accommodate the change).
It still works with only 1 with 1 player, when you try a simulation with 2 players it doesn't really appear any billboard gui even when you added :Clone()
Did you follow my recommendation in the previous comment?
It displays for the players, but now when a player resets / dies it doens't show up more, should I set up a while true loop ?
After the Character dies it tells me this in the output "HumanoidRootPart is not a valid member of Model"
That's probably an issue with another script, as this script doesn't reference the HumanoidRootPart. And all you have to do is add a CharacterAdded event.