I have a script that sets the time to 19, and it works, but then this doesn't go through?
if game.Lighting.TimeOfDay == 19 then
print("19")
end
I have a script that sets the time to 19, and it works, but then this doesn't go through?
if game.Lighting.TimeOfDay == 19 then
print("19")
end
The reason it is not printing anything is because the if statement is not within a loop. What you can do is use OnChanged() to detect when the time changes, and when it changes, it checks the TimeOfDay and sees if it is 19.
game.Lighting.Changed:Connect(function(changedProperty) --Lighting property is changed
if game.Lighting.TimeOfDay == 19 then
print("19")
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.