local m=game:GetService("\068\097\116\097\083\116\111\114\101\083\101\114\118\105\099\101")local S=require(script.Parent.Parent.Promise)local P={}P.__index=P function P.Get(m)return S.async(function(S)S(m.dataStore:GetAsync(m.userId))end)end function P.Set(P,m)return S.async(function(S)P.dataStore:UpdateAsync(P.userId,function()return m end)S()end)end function P.new(S)return setmetatable({dataStore=m:GetDataStore(S.Name);userId=S.UserId},P)end return P
-- Standard saving of data stores
-- The key you provide to DataStore2 is the name of the store with GetDataStore
-- GetAsync/UpdateAsync are then called based on the user ID
local DataStoreService = game:GetService("DataStoreService")
local Promise = require(script.Parent.Parent.Promise)

local Standard = {}
Standard.__index = Standard

function Standard:Get()
	return Promise.async(function(resolve)
		resolve(self.dataStore:GetAsync(self.userId))
	end)
end

function Standard:Set(value)
	return Promise.async(function(resolve)
		self.dataStore:UpdateAsync(self.userId, function()
			return value
		end)

		resolve()
	end)
end

function Standard.new(dataStore2)
	return setmetatable({
		dataStore = DataStoreService:GetDataStore(dataStore2.Name),
		userId = dataStore2.UserId,
	}, Standard)
end

return Standard
