Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[Datastore][Edited] Why does this not output??

I have ban's in the storage but I get no output from it, why would this not work?

I have checked the wiki several times to make sure it would work and even though it looked correct; I get no output, nothing.

local CDS = game:GetService("DataStoreService"):GetOrderedDataStore(Gravity_V4._DATASTORESync.BanlistLink)
local CPage = 1
local Page = CDS:GetSortedAsync(false, 5)
for k,v in pairs(Page:GetCurrentPage()) do

	print(k,v)  -- I get no print or output.

end)

1 comment

1

Any comments or anything like that will be highly helpful!

1 answer

✓ Accepted answer

This problem is very subtle, but it looks to me that Ordered Datastores are 0-indexed, not 1-indexed. What this means is that the first page is page '0', not page '1'.

To fix this, change line 2 to local CPage = 0.

This discussion is preserved as it was. New answers, comments, and votes are closed.