function DataStore.Debug(a,...)if a.debug then print(...)end end function DataStore._GetRaw(a)if not a.getQueue then a.getQueue=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")end if a.getting then a:Debug("\065 \095\071\101\116\082\097\119 \105\115 \097\108\114\101\097\100\121 \105\110 \109\111\116\105\111\110\044 \106\117\115\116 \119\097\105\116 \117\110\116\105\108 \105\116\'\115 \100\111\110\101")a.getQueue.Event:wait()a:Debug("\065\097\097\110\100 \119\101\'\114\101 \098\097\099\107")return end a.getting=true local T,X=a.savingMethod:Get()a.getting=false if not T then error(tostring(X))end a.value=X a:Debug("\118\097\108\117\101 \114\101\099\101\105\118\101\100")a.getQueue:Fire()a.haveValue=true end function DataStore._Update(T,a)if not a then for a,X in pairs(T.callbacks)do X(T.value,T)end end T.haveValue=true T.valueUpdated=true end

function DataStore:Debug(...)
	if self.debug then
		print(...)
	end
end

function DataStore:_GetRaw()
	if not self.getQueue then
		self.getQueue = Instance.new("BindableEvent")
	end

	if self.getting then
		self:Debug("A _GetRaw is already in motion, just wait until it's done")
		self.getQueue.Event:wait()
		self:Debug("Aaand we're back")
		return
	end

	self.getting = true

	local success, value = self.savingMethod:Get()

	self.getting = false
	if not success then
		error(tostring(value))
	end

	self.value = value

	self:Debug("value received")
	self.getQueue:Fire()

	self.haveValue = true
end

function DataStore:_Update(dontCallOnUpdate)
	if not dontCallOnUpdate then
		for _,callback in pairs(self.callbacks) do
			callback(self.value, self)
		end
	end

	self.haveValue = true
	self.valueUpdated = true
end
