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?

2 comments
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
Im not sure then...