local M=ds:GetOrderedDataStore("\076\066")players.PlayerAdded:Connect(function(M)local c=Instance.new("\070\111\108\100\101\114")c.Name="\108\101\097\100\101\114\115\116\097\116\115"c.Parent=M local Z=Instance.new("\078\117\109\098\101\114\086\097\108\117\101")Z.Name="\067\108\105\099\107\115"Z.Parent=c local N=Instance.new("\078\117\109\098\101\114\086\097\108\117\101")N.Name="\071\101\109\115"N.Parent=c local z=Instance.new("\078\117\109\098\101\114\086\097\108\117\101")z.Name="\082\101\098\105\114\116\104\115"z.Parent=c end)while true do for c,Z in pairs(players:GetPlayers())do local N,z=pcall(function()M:SetAsync(Z.UserId,Z.leaderstats.Rebirths.Value)end)end task.wait(10)end
--
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
