Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I have a little problem with my overhead guis?

So when a player joins, he should have a gui over his head displaying his wins. Some people have it, and some don't. Please help.

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(char)
		if char:FindFirstChild("Head") and player then
			local clone = script.BillboardGui:Clone()
			clone.Parent = char:FindFirstChild("Head")
			clone.TextLabel.Text = (player:WaitForChild("leaderstats"):WaitForChild("Wins").Value)
			clone.TextLabel.TextColor3 = Color3.fromRGB(255, 242, 208)
			player:WaitForChild("leaderstats"):WaitForChild("Wins"):GetPropertyChangedSignal("Value"):Connect(function()
				clone.TextLabel.Text = (player:WaitForChild("leaderstats"):WaitForChild("Wins").Value)
			end)
		end
	end)
end)

2 comments

0

Where is this placed and what type of script is it

0

It's a server script and its in workspace

1 answer

Maybe try adding local head = char:WaitForChild("Head") directly after the characteradded in case it hasn't loaded yet.

This discussion is preserved as it was. New answers, comments, and votes are closed.