Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Time of day, needing an equal or not?

/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?

3 comments

0

No, it says "Expected 'then', got '='".

0

I'm asking if it would require = to function, not for the expected then.

1

put the then on line 1

1 answer

✓ Accepted answer

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

1 comment

0

thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.