PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

GetGlobalDataStore

This function returns the default GlobalDataStore. If you want to access a specific named data store instead, you should use the DataStoreService/GetDataStore|GetDataStore() function.

Returns

Return Type Summary

Default GlobalDataStore instance


Code Samples


Get GlobalDataStore Instance

The following example retrieves a default data store instance which behaves like a regular Instance. Since a GlobalDataStore is an Instance, functions such as Instance/GetChildren|GlobalDataStore:GetChildren() will execute without error.

local DataStoreService = game:GetService("DataStoreService")

local GlobalDataStore = DataStoreService:GetGlobalDataStore()
print(GlobalDataStore.Name)