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

Getting an orderded datastore from a list datastore?

local DataStoreService = game:GetService("DataStoreService")
local MainDataStore = DataStoreService:GetDataStore("MainDataStore")
local InfectedLeaderboard = MainDataStore["TotalInfected"]
local InfectedLeaderBoard = DataStoreService:GetOrderedDataStore(InfectedLeaderboard)

I'm trying to create a global leaderboard and I save everyone's progress in a table. I have tried multiple ways but it keeps giving me this error

TotalInfected is not a valid member of GlobalDataStore

Any ideas?

1 answer

Try :

local InfectedLeaderboard = MainDataStore:WaitForChild("TotalInfected")

2 comments

0

I get this Infinite yield possible on 'DataStoreService.MainDataStore:WaitForChild("TotalInfected")' because TotalInfected is not a object, it's inside of a list which is saved to MaindataStore

0

Im not sure then...

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