Both ways work. If you test the game, you should see the message appear 2 times. That means both works. So in theory, yes, the order doesn’t matter. Not in all cases, though.
Here’s a little fun fact, if statements by default check if the value isn’t nil or false, if it is anything else it will go through, so you can just do this:
local var = true
if var then
print("true!")
end
same as doing:
local var = true
if var ~= nil and var ~= false then
print("true!")
end
What i’m saying is that you don’t need to check on neither, you can just do:
if party1 and party2 then
print("Both parties are true")
end
Wrt “Not all cases”: This way works as long as reading the value of party2 has no side effects. If party1 is false, then party2 will not be read as its result doesn’t matter, so any side effects of reading party2 will not be triggered. This will almost never apply, though, so don’t worry about it.