There's a part in workspace called BillPart, with a billboardgui inside of it named nameb. When a player joins, the billboardgui gets cloned, and the cloned gui's adornee gets set to the player's head. So, the script works but the BillboardGui disappears when the player dies. Script:
-- skip this part
game.Players.PlayerAdded:connect(function(plr)
while not plr.Character do wait() end
local g = game.Workspace.BillPart.Nameb:Clone()
g.Parent = game.Workspace.BillPart
game.Workspace.BillPart.Nameb.Adornee = plr.Character.Head
game.Workspace.BillPart.Nameb.SizeOffset = Vector2.new(0,1)
while true do
wait()
game.Workspace.BillPart.Nameb.TextButton.Text = plr.Name.." | Level: "..plr.leaderstats.Lvl.Value
end
end)
-- this is what i tried to make it not go away
game.Players.PlayerAdded:connect(function(plr)
while not plr.Character do wait() end
plr.Character.Humanoid.Died:connect(function()
local g = game.Workspace.BillPart.Nameb:Clone()
g.Parent = game.Workspace.BillPart
game.Workspace.BillPart.Nameb.Adornee = plr.Character.Head
game.Workspace.BillPart.Nameb.SizeOffset = Vector2.new(0,1)
while true do -- yes i know i could use the changed event
wait()
game.Workspace.BillPart.Nameb.TextButton.Text = plr.Name.." | Level: "..plr.leaderstats.Lvl.Value
end
end)
end)

1 comment
still doesnt come back when the player dies :/