I'm making an auto-updating leaderboard for an obby game. I already have a working timer script that records times onto a datastore. I'm trying to sort it using an ordered datastore. It doesn't seems to print anything when I test it.
local DataVersion = "2"
local DataStoreService = game:GetService("DataStoreService")
local SpeedrunTime = DataStoreService:GetOrderedDataStore(DataVersion.."SpeedrunTimer")
function updateLB()
local sorted = SpeedrunTime:GetSortedAsync(true,25)
local entries = sorted:GetCurrentPage()
for _, entry in pairs(entries) do
--for each of the top 25 runs it does thing
print(entry.key .. " : " .. tostring(entry.value))
script.Parent.SurfaceGui.TextButton.Time.Text = entry.value
end
end
updateLB()
while wait(60) do
pcall(function()
updateLB()
end)
end
