How do I use datastores to keep track of how many points a player has

Hello everyone!

For Christmas this year, I’m making an advent calendar that has a ‘daily log in’ feature for everyday you join, you get a Christmas point.

If you get 10 Christmas points, you will unlock the badge.

How do I save how many Christmas points a player has and how would I make sure that then don’t rejoin and claim their Christmas point again for the same day? I’m guessing I would use datastores but I’ve never touched them in my life.

local Calendar = script.Parent
local Frame = Calendar.Parent

local"*t", os.time())

if CurrentDate.month == 12 then
	for _,day in ipairs(Calendar:GetChildren()) do
		if day:IsA("Frame") then
			local dayNo=tonumber(day.Name)
			if dayNo< then -- dayNo is less than today so mark as unavailable 
				day.BackgroundColor3 = Color3.fromRGB(150, 150, 150)
				day.Button.Text = "UNAVAILABLE"
			elseif then -- dayNo is today
				day.BackgroundColor3 = Color3.fromRGB(115,255,115)
				day.Button.Text = "CLAIM"
			elseif dayNo> then -- dayNo is greater than today so set to coming soon
				day.BackgroundColor3 = Color3.fromRGB(255, 80, 80)
				day.Button.Text = "COMING SOON"	


Thanks in advance!

It would be a tremendous pain in the neck for anybody to write a whole tutorial here just for you, but I’ll at least save you the hassle of doing a search. Here are some official resources:
Official API documentation
Devhub tutorial
And here are some resources I found with a quick Google search:
AlvinBlox on YouTube
DivineBlaze on YouTube
TheDevKing on YouTube
B Ricey on YouTube
Trelakor on YouTube
Syreno on YouTube
BlazeSword on YouTube

Tutorial on

These are posts I found from searching for ‘datastore’ on the Developer Forum in the Tutorials section:
Post by GEILER123456
Post by Flameyz




It’s just the fact that most of the tutorials are about leaderstats so that doesn’t really cover my problem.

1 Like

They can be adapted with little difficulty. If you learn the concepts, you will be able to use DataStores to save and retrieve data however you want and do with the data what you want. Leaderstands are just a common use for DataStores and since you need some sort of working code as an example, they use leaderstats in the tutorials.

1 Like