Basic SetMinutesAfterMidnight script isn't working?

Hi. I made a script that plays audio after 4am in ROBLOX, but it doesn’t work, even after reading all the developer hub posts and watching this tutorial

Day/Night Cycle: Time of Day - YouTube

if game.Lighting:SetMinutesAfterMidnight(4*60) == true then
		workspace.Birds:Play()
	end
1 Like

SetMinutesAfterMidnight sets the time, the function does not verify it, you must use ClockTime

if game:GetService("Lighting").ClockTime == 4 then
	workspace.Birds:Play()
end

or use GetMinutesAfterMidnight

if game:GetService("Lighting"):GetMinutesAfterMidnight() == 4*60 then
	workspace.Birds:Play()
end
3 Likes