DataStore problem

hi, i wanted to make my own DataStore 3 but i can’t make a thing to stop the script if DataStore is dezactived, how to make that? i searched on devforum for a similar topic

Be more precise. Do you mean disabling?

1 Like


Can you please actually explain what you’re trying to do? Right now it’s just “things” and “how to make”. It’s hard to understand what you actually want.

1 Like

only a script that detect if the DataStore is disabled or not, is a roblox made thing or should i made a custom thing to detect if an request gets a error?

Can you even “disable” a datastore…? I don’t understand what you’re saying. Unless you’re trying to make a datastore error handler which I doubt it based on what you’re saying…

I think what he’s trying to say is how do you prevent a script from continuing/detect if data store errors.

Might be wrong.

here u can disable the datastore:


how can i detct if it is off? if u respond good, i will give u Solution!

When a datastore fails in any way, it will return with their error codes. You can view the full list here. For your case, if “Enable Studio Access to API Services” is turned off, it will return with a 502 Error. There is currently no way to specifically tell that “Enable Studio Access to API Services” is turned off, so you’ll have to handle ALL errors (which is good, infact).

In this case, you can use pcall() for it.

local success, error = pcall(function()
-- blah blah datastore save blah

if not success then
    -- error happened here, either ur stuff is disabled/whatever error/whatever
    -- do your error handling here

Also; disabling that won’t disable datastores. It will only restrict studio access to API services such as datastores. Your datastores should still work fine if you’re playing through the normal Roblox. So your topic is VERY misleading.