OrderedDataStore datamodel help

I wanted to use @berezaa’s idea for the datastore, putting timestamps in the orderedDataStore and then data models with the timestamp as the key into the datastore. The problem is that i cant seem to be able to extract these timestamps from the orderedDataStore:

    local success, plrKeys = pcall(listGet, meta, false, 10)
	
	while not success do wait(1)
		print(plrKeys)
		success, plrKeys = pcall(listGet, meta, false, 10)
	end
	
	plrKeys = plrKeys:GetCurrentPage()
	
	
	
	local highest = 0
	for _, i in pairs(plrKeys) do
		print(i[0])
		if i[1] then
			if i > highest then
				highest = i
			end
		end
	end

did i make any logic/indexing errors? if anyone has any answers, they would be greatly appreciated. :3

1 Like

oh btw, meta is a variable containing OrderedDataStore, listGet is meta.GetOrderedAsync. In the ordered datastore are timestamps (os.time()) and the script is meant to find the latest one. for some reason though, even though player data has been saved to the datastore, every array in GetCurrentPage() have only nil.

1 Like

Am i missing necessary information that is needed to solve this problem, or is there little knowledge out there on the orderedDataStore?

Use datastore2 if you’re already considering using Berezaa’s method of saving data.

I have it all made already. All that it needs for it to function as is should is that code segment ^^^, which seems to have a minor problem to which i cannot find

Nevermind, i reworked the system for it to function properly.