Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Time of day, needing an equal or not?

Asked by 6 years ago

/example

if game.Lighting.TimeOfDay = "05:35:00"
    then 
end

this script is not finished, however, I need to know if having "=" would make it not work, because in the Script Analysis, it says it does not need = to function properly?

0
No, it says "Expected 'then', got '='". hiimgoodpack 2009 — 6y
0
I'm asking if it would require = to function, not for the expected then. Deploy_Coffee 7 — 6y
1
put the then on line 1 Viking359 161 — 6y

1 answer

Log in to vote
0
Answered by
DanzLua 2879 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

You can not change something within a if statement the section between 'if' and 'then' is used to check if it is true or false. Your example is attempting to change the value of TimeOfDay which will error, you'd have to use '==', which will return true in this case (which is either true or false making the if statement happy (happy? lol)) to check if it equal to it for not.

if game.Lighting.TimeOfDay == "05:35:00"
    then 
end
0
thanks Deploy_Coffee 7 — 6y
Ad

Answer this question