Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Getting an orderded datastore from a list datastore?

Asked by 4 years ago
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

Log in to vote
0
Answered by
6zk8 95
4 years ago

Try :

local InfectedLeaderboard = MainDataStore:WaitForChild("TotalInfected")
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 Barty200 85 — 4y
0
Im not sure then... 6zk8 95 — 4y
Ad

Answer this question