How Can I Use GlobalDataStores?

Hello! I was wondering, how I would go about using GlobalDataStores in my game? (Withing The Same Game/Universe)

Help would be appreciated!

Something I Found:
DataStoreService:GetGlobalDataStore()

Would the above work like a normal datastore?

1 Like

Your typical data store from DataStoreService::GetDataStore is also a global data store.

According to the documetation

This function returns the default GlobalDataStore.

Not too sure what “the” means. But it doesn’t allow you to name a data store, so just continue using :GetDataStore

GetGlobalDataStore returns the default GlobalDataStore. It’s like GetDataStore (which also returns a GlobalDataStore object) except no name is provided.

So, would I use Global or Default?

You probably would want to use named data stores with GetDataStore. Besides that they are functionally identical.

So, there is no difference between those two?

The default one is just like a data store with no name. That’s all it is.

use it depending on what your use case is, to save player data use the normal DataStore.

image

If there is no name, then how would I retrieve and add data to The default global data store?

There’s only one GlobalDataStore. Wherever and whenever you call :GetGlobalDataStore() it will return the same datastore.

2 Likes