Leaderboard code help please

Hi guys,

I can’t figure out why this code stops at “c”. I have confirmed that the datastore does have saved data in it. So not sure why it just stops there. Any help would be great thanks.

Code:

local DataStoreService = game:GetService("DataStoreService")
local QuestData = DataStoreService:GetOrderedDataStore("QUESTLB01")

local abbreviations = {
	K = 4,
	M = 7,
	B = 10,
	T = 13,
	Qa = 16,
	Qi = 19,
	Sx = 22,
	Sp = 25,
	Oc = 28,
	No = 31,
	Dc = 34
}

local function GetQuest()
	local Success, Err = pcall(function()
		print("a")
		local Data = QuestData:GetSortedAsync(false, 100)
		print("b")
		local Page = Data:GetCurrentPage()
		print("c")
		for rank, data in ipairs(Page) do
			print("d")
			local Name = data.key
			print("e")
			local Amount = data.value
			print("f")
			local text = tostring(math.floor(Amount))
			print("g")
			local chosenabbreviation
			for i,v in pairs(abbreviations) do
				if #text >= v and #text < (v + 3) then
					chosenabbreviation = i
					break
				end
			end
			print("h")
			if chosenabbreviation then
				local digits = abbreviations[chosenabbreviation]
				local rounded = math.floor(Amount / 10 ^ (digits - 2)) * 10 ^ (digits - 2)
				text = string.format("%.1f", rounded / 10 ^ (digits - 1))..chosenabbreviation
			else
				text = Amount
			end
			print("i")
			local NewObj = game.ReplicatedStorage.LBFrame:Clone()
			NewObj.Player.Text = Name
			NewObj.Amount.Text = text
			NewObj.Rank.Text = "#"..rank
			NewObj.Parent = game.Workspace.Leaderboard_Quests.GUI.Frame
			print("j")
		end
	end)
	if not Success then
		error(Err)
	end
end



while true do
	wait(30)
	local frames = game.Workspace.Leaderboard_Quests.GUI.Frame:GetChildren()
	for i,v in pairs(frames) do
		if v:IsA("Frame") then
			v:Destroy()`Preformatted text`
		end
	end
	wait()
	GetQuest()
	print("updating quest LB")	
end

Try using “pairs” instead of “ipairs”

Thanks MysteriousVagabond but it still stops at “c”

Have you tried printing what Page is…?

Hi LordMerc printing Page is “table: 0x4a473264d9e481df” Thanks

Make sure to have your expressive output on! (Expressive Output Window - Beta)

Print the length of it, and show screenshots not just copy and paste of the output.

Try doing this maybe?

table.foreach(Page,function(Obj)
print(Obj)
end)