Basically The Day Part Is Working And It Prints The Word But When It Reaches Night Nothing Is Printed And I Don't Know Why
Its Meant To Enable An AI Script At Night And Disable During The Day
Here Is My Script:
while true do wait(1) if game.Lighting.ClockTime > 6.3 and game.Lighting.ClockTime < 18.5 then print("Day") script.Parent.Disabled = true elseif game.Lighting.ClockTime < 6.3 and game.Lighting.ClockTime > 18.5 then print("Night") script.Parent.Disabled = false end end
I Found My Own Answer:
while true do wait(1) if game.Lighting:GetMinutesAfterMidnight() > 6.3 * 60 then print("Day") script.Parent.Disabled = true end if game.Lighting:GetMinutesAfterMidnight() < 6.3 * 60 then print("Night") script.Parent.Disabled = false end end
You can fix your original code by using or
instead of and
on line 6 (since the ClockTime can't possibly be < 6.3 and > 18.5 simultaneously), or replacing line 6 with else
.