Understanding datastore & basic structure

Whats up forum, so I’m having trouble with understanding how datastores work, I read docs. etc but still don’t know where to start, so please guide me, (I also don’t wanna use third party codes so don’t suggest, wanna learn first)

local module = {}

local DSS = game:GetService("DataStoreService")
local DataStore = DSS:GetDataStore("PlayerData")

local DEFAULT_TEMPLATE = {
	
	ExampleCoins = 0,
	ExampleWins = 0,
	EquippedXValue = nil,
	EquippedYValue = nil,
	OwnedXValue= {},
	OwnedXValue = {},
}

function module:SaveData(player: Player)
	local userId = player.UserId
	
--	???????
	

end


return module
1 Like