Like this, correct?
local nametag = game:GetService("ServerStorage").BillboardGui
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local leaderstats = player:WaitForChild("leaderstats")
local timeAlive = leaderstats:WaitForChild("Time Alive")
local BillboardGUI = nametag:Clone()
BillboardGUI.Parent = char:FindFirstChild("Head")
BillboardGUI.NameLabel.Text = player.Name
wait (1)
BillboardGUI.TextLabel.Text = tonumber(timeAlive.Value)
local humanoid = char:WaitForChild("Humanoid")
humanoid:GetPropertyChangedSignal("Health"):Connect(function()
BillboardGUI.HP.Text = humanoid.Health
end)
end)
end)
The timer went up to “1” and stopped there…
ProBaturay
(Programmer)
#63
local players = game:GetService("Players")
local nametag = game:GetService("ServerStorage").BillboardGui
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local leaderstats = player:WaitForChild("leaderstats")
local timeAlive = leaderstats:WaitForChild("Time Alive")
local BillboardGUI = nametag:Clone()
BillboardGUI.Parent = char:FindFirstChild("Head")
BillboardGUI.NameLabel.Text = player.Name
wait(1)
BillboardGUI.TextLabel.Text = tonumber(timeAlive.Value)
local humanoid = char:WaitForChild("Humanoid")
humanoid:GetPropertyChangedSignal("Health"):Connect(function()
BillboardGUI.HP.Text = humanoid.Health
end)
end)
end)
Just use this script:
game.Players.PlayerAdded:Connect(function(player)
if not player.Character then player.CharacterAdded:Wait() end
-- Do what you want here.
end)
By “donated robux” you mean timeAlive?
@ProBaturay ,
The timer stopped at “1” and froze there.
ProBaturay
(Programmer)
#67
This is correct I guess. . . .
ProBaturay
(Programmer)
#68
Sorry I meant timeAlive. I feel so sleepy. I don’t know what I’m writing.
Everything almost worked except the time just went to 1 and stopped there for some reason…
ProBaturay
(Programmer)
#70
If you have a script out of this script and if it handles the timer so just use
timeAlive.Changed:Connect(function()
BillboardGUI.TextLabel.Text = tonumber(timeAlive.Value)
end)
Add those before last three lines.
RFL890
(GeorgeCatherington)
#71
Make sure nametag remains in ServerStorage. Then:
(Used it in our boombox game so I know it works)
local Players = game:GetService'Players';
local ServerStorage = game:GetService'ServerStorage';
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Clone = ServerStorage:WaitForChild'BillboardGui';
Clone = Clone:Clone();
Clone.Parent = Character.Head;
end)
end)
Also if you say you should have cloned it at the start, you’re wrong. You must clone it every time a plr joins.
The script finally works as intended!
Thank you for your help man!
(Marked your post as a solution)
1 Like