01 | local light = script.Parent |
02 | local timeofday = game.Lighting.TimeOfDay |
03 |
04 | while true do |
05 | wait( 1 ) |
06 | if timeofday > "17:45:00" and timeofday < "06:20:00" then |
07 | print ( "its night" ) |
08 | light.Angle = 180 |
09 | light.Brightness = 10 |
10 | light.Range = 12 |
11 | else |
12 | print ( "its day" ) |
13 | light.Angle = 0 |
14 | light.Brightness = 0 |
15 | light.Range = 0 |
16 | end |
17 | end |
The output keeps on printing that it's day..
I don't get how to fix it. is it because of comparing with strings instead of numbers? And if it is, how would i convert time of day to numbers? It doesn't let me write the time of day as a number without an error.