Which is the best to use?
-- 1
local DataStoreService = game:GetService('DataStoreService')
local DataStore = DataStoreService:GetDataStore('MyData')
or
-- 2
local DataStore = game:GetService('DataStoreService'):GetDataStore('MyData')
Which is the best to use?
-- 1
local DataStoreService = game:GetService('DataStoreService')
local DataStore = DataStoreService:GetDataStore('MyData')
or
-- 2
local DataStore = game:GetService('DataStoreService'):GetDataStore('MyData')
Depends. If you’re going to use multiple data stores, use the first one. Otherwise the second one if you’re only going to use one data store. Performance-wise doesn’t affect anything.