Error 429 "Too many requests" - DataStore:ListKeysAsync()

Hello! I was making a leaderboard system (which is complete) and works perfectly inside Roblox Studio. Inside the roblox client however, I get this error:


502: API Services rehected request with error. HTTP 429 (Too Many Requests)
here is my code:

local listSuccess, pages = pcall(function()
	return playerData:ListKeysAsync("Player_")
end)
if listSuccess then
	while wait(.1) do
		local items = pages:GetCurrentPage()
		for i, v in ipairs(items) do
			local value = playerData:GetAsync(v.KeyName)
			--print("Key: ", v.KeyName, "Value: ", value)
			local name:string = v.KeyName
			name = name:gsub("Player_", "")
			doors[name] = value["Doors"]
		end
		if pages.IsFinished then
			break
		end
		pages:AdvanceToNextPageAsync() --THIS IS CAUSING THE ERROR 429
	end
end

Please let me know if it is as simple as the code is running it too fast.
All help is appreciated!

I followed a YT tutorial on “How to make a global leaderboard in Roblox Studio”

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.