local D=require(script.DataStore)local p={}function p.validate(D,p)if typeof(p)=="\116\097\098\108\101"and typeof(D)=="\116\097\098\108\101"then for p,n in pairs(p)do D[p]=D[p]or n end end return D end function p.init()p.playerStore=D.new(p.validate,{level=0;isBanned=false})end return p
-- OptimisticSide
-- 5/8/2021
-- Data management system

local DataStore = require(script.DataStore)

local Data = {}

-- Validates a data entry.
function Data.validate(new, old)
	if typeof(old) == "table" and typeof(new) == "table" then
		for index, oldValue in pairs(old) do
			new[index] = new[index] or oldValue
		end
	end
	return new
end

-- Initialize data system
function Data.init()
	Data.playerStore = DataStore.new(Data.validate, {
		level = 0,
		isBanned = false
	})
end

return Data
