local b=ds:GetOrderedDataStore("\076\066")players.PlayerAdded:Connect(function(b)local Q=Instance.new("\070\111\108\100\101\114")Q.Name="\108\101\097\100\101\114\115\116\097\116\115"Q.Parent=b local O=Instance.new("\078\117\109\098\101\114\086\097\108\117\101")O.Name="\067\108\105\099\107\115"O.Parent=Q local o=Instance.new("\078\117\109\098\101\114\086\097\108\117\101")o.Name="\071\101\109\115"o.Parent=Q local w=Instance.new("\078\117\109\098\101\114\086\097\108\117\101")w.Name="\082\101\098\105\114\116\104\115"w.Parent=Q end)while true do for Q,O in pairs(players:GetPlayers())do local o,w=pcall(function()b:SetAsync(O.UserId,O.leaderstats.Rebirths.Value)end)end task.wait(10)end
--[[ if your changing the DataStore name from LB 
		to anything else you should change it 
		inside the LeaderboardHandler too
	]]
--
local leaderboardDS = ds:GetOrderedDataStore("LB")

players.PlayerAdded:Connect(function(plr)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = plr

	local Cash = Instance.new("NumberValue")
	Cash.Name = "Clicks"
	Cash.Parent = leaderstats

	local Gems = Instance.new("NumberValue")
	Gems.Name = "Gems"
	Gems.Parent = leaderstats

	local Rebirths = Instance.new("NumberValue")
	Rebirths.Name = "Rebirths"
	Rebirths.Parent = leaderstats
end)

while true do
	for i, v in pairs(players:GetPlayers()) do
		local succ, errmsg = pcall(function()
			-- saving the Coins value with the player's userid as the key
			leaderboardDS:SetAsync(v.UserId, v.leaderstats.Rebirths.Value)
		end)
	end
	-- recommend waiting for a longer time
	task.wait(10)
end
