So lets say it was time 00:0000 (24), how could I make a script activate? Eg; Nightlights
✓ ANSWER ACCEPTED
How can I make a script activate when it is a certain time of day?
1 answer
✓ Accepted answer
Hi, IPhoneDrew. The solution to your question, "How can I make a script activate when it is a certain time of day?", can be found on the Changing Time of Day – Making a Day/Night Cycle
-- This code is completely from the wiki linked above
lightPart = game.Workspace.LightPart
minutesAfterMidnight = 0
while true do
minutesAfterMidnight = minutesAfterMidnight + 10
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(0.1)
if game.Lighting:GetMinutesAfterMidnight() == 6 * 60 then -- checks for 6AM
lightPart.Material = Enum.Material.Plastic
lightPart.PointLight.Enabled = false
end
if game.Lighting:GetMinutesAfterMidnight() == 18 * 60 then -- checks for 6PM
lightPart.Material = Enum.Material.Neon
lightPart.PointLight.Enabled = true
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thank you!