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

Question about if then statements?

Asked by 6 years ago

Can I have an if that tests for a local value (dhour), and then if it's true have a then that runs an if statement to test for a seperate value so they must both be true?

This is what I have if dhour == 7 then if dmin == 30 then script.Rise.Playing = true end end

1 answer

Log in to vote
0
Answered by 6 years ago

Well, assuming you have 2 separate values with one being the hour and the other being min, you can do that.

There’s another way that I’d prefer though if your first conditional statement only moves onto the next conditional statement and doesn’t do anything else. You can use “and”.

Here’s an example :

if dhour == 7 and dmin == 30 then
script.Rise.Playing == true
end

Hope this helped!

Ad

Answer this question