Global leaderboard not working

So when i go to the testing place of my game this leaderboard works totally fine. But once i publish it to the main game it just breaks and doesnt show anything at all

image

local dss = game:GetService("DataStoreService")
local MoneyLeaderboard = dss:GetOrderedDataStore("LeaderboardDataSave")

local function updateLeaderboard()
	local success, err = pcall(function()
		local data = MoneyLeaderboard:GetSortedAsync(false,6)
		local LevelPage = data:GetCurrentPage()
		for r,d in ipairs(LevelPage) do
			local userName = game.Players:GetNameFromUserIdAsync(tonumber(d.key))
			local Name = userName
			local Level = d.value
			local IsOnLeaderboard = false
			for i,v in pairs(script.Parent.SurfaceGui.Leaderboard:GetChildren()) do
				if v.Rank.Text == Name then
					IsOnLeaderboard = true
					break
				end
			end

			if IsOnLeaderboard == false then
				local newFrame = game.ServerStorage.UI.LeaderboardRank:Clone()
				newFrame.Rank.Text = Name
				newFrame.Rank.Money.Text = "$"..tostring(Level)
				newFrame.Position = UDim2.new(0,0,newFrame.Position.Y.Scale + (.13 * #script.Parent.SurfaceGui.Leaderboard:GetChildren()))
				newFrame.Parent = script.Parent.SurfaceGui.Leaderboard
			end
		end
	end)

	if not success then
	end
end

updateLeaderboard()

while wait(25) do
	for i,p in pairs(game.Players:GetPlayers()) do
		MoneyLeaderboard:SetAsync(p.UserId, p.leaderstats.Money.Value)
	end

	for i, f in pairs(script.Parent.SurfaceGui.Leaderboard:GetChildren()) do
		f:Destroy()
	end
	updateLeaderboard()
end

DataStores are local to each specific game. So if your test game and main game are separate game entities, it will not save the same data. Perhaps you just have not saved any data to that game yet?

I do not want to send that data to my main game. There are around 25 people playing my game right now and i want their data to be saved and shown on that leaderboard. The scripts works totally fine for my level leaderboard (which uses the same technique and lines of code). But the money one just dies with no errors