Help with os.date

I am trying to kick a player from a game when it is a certain day but it doesn’t seem to be kicking the player. I have checked on the developer form and on google but couldn’t find anything that helped me.

Here is the script I have:

game.Players.PlayerAdded:Connect(function(player)
	while true do
		wait(1)
		if os.date({month=12, day=19}) then
			player:kick("you have been kicked")
		end
	end
end)
1 Like

Why check every second? Also, I believe to use os.date like that you need the year, try using from this forum Os.time week countdown - #4 by Usering.

game.Players.PlayerAdded:Connect(function(player)
	while true do
		wait(1)
		local month, day = os.date("!*t")["month"], os.date("!*t")["day"]
		if month == 12 and day == 19 then
			player:kick("you have been kicked")
		end
	end
end)
1 Like