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.
Script
local Calendar = script.Parent
local Frame = Calendar.Parent
local CurrentDate=os.date("*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<CurrentDate.day then -- dayNo is less than today so mark as unavailable
day.BackgroundColor3 = Color3.fromRGB(150, 150, 150)
day.Button.Text = "UNAVAILABLE"
elseif dayNo==CurrentDate.day then -- dayNo is today
day.BackgroundColor3 = Color3.fromRGB(115,255,115)
day.Button.Text = "CLAIM"
elseif dayNo>CurrentDate.day then -- dayNo is greater than today so set to coming soon
day.BackgroundColor3 = Color3.fromRGB(255, 80, 80)
day.Button.Text = "COMING SOON"
end
end
end
end
Thanks in advance!