Modulescript/DataStore Question

Are you able to use ModuleScripts to hold datastores, and call said datastores from a serverside script globally?

Module:

local pDM = {}
-- Services
local DataS = game:GetService('DataStoreService')
local RepS = game:GetService('ReplicatedStorage')


pDM.DataStores={

MainInventory = DataS:GetDataStore('MainInventory');
LastGameData = DataS:GetDataStore('LastGameData');
LiveCodes = DataS:GetDataStore('LiveCodes');
	
	
}

ServerScript:

PDM.DataStores.MainInventory:GetAsync()

Would this work properly?

Short Answer: Yes.

Long Answer: Yes if the module is only required on the server.

Thanks, brother!

-vince!!charchar

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.