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

How can I check if a DataStore exists already?

Asked by
3F1VE 257 Moderation Voter
2 years ago
Edited 2 years ago

I am making a DataStore module for ease of access and I plan on releasing it soon but I would like to know how can I check if a DataStore already exists? ( have a method but I am afraid it will flood DataStore requests. Here is the method :

for _, v in pairs(DataStoreService:ListDataStoresAsync()) do 
    if v.Name == DataStore.Name then 
        return warn("Use an existing datastore!") 
    end 
end
0
you iterate the pages incorrectly, see code at the bottom here: https://developer.roblox.com/en-us/api-reference/function/DataStoreService/ListDataStoresAsync it won't flood data store imKirda 4491 — 2y
0
both options are optional 3F1VE 257 — 2y

Answer this question