As of now, I've been using a mix of two:
method 1:
1 | local condition 1 = true |
2 | local condition 2 = true |
3 | local condition 3 = true |
4 |
5 | if condition 1 and condition 2 and condition 3 then |
6 | print ( "all conditions are true" ) |
7 | end |
method 2:
01 | local condition 1 = true |
02 | local condition 2 = true |
03 | local condition 3 = true |
04 |
05 | if condition 1 then |
06 | if condition 2 then |
07 | if condition 3 then |
08 | print ( "all conditions are true" ) |
09 | end |
10 | end |
11 | end |
Hi Marmalados,
01 | method 1 = 0 -- Will count how many times method 1 came out to be successful in the trials. |
02 | method 2 = 0 -- WIll count how many times method 2 came out to be successful in the trials. |
03 |
04 | for x = 1 , 100000 do -- Runs 100 thousand trials on the code. |
05 | t 1 = tick() |
06 |
07 | if workspace:FindFirstChild( "Script" ) and workspace:FindFirstChild( "Baseplate" ) then |
08 | end |
09 |
10 | t 1 = tick() - t 1 |
11 |
12 | t 2 = tick() |
13 |
14 | if workspace:FindFirstChild( "Script" ) then |
15 | if workspace:FindFirstChild( "Baseplate" ) then |
Thanks,
Best regards,
KingLoneCat
The first statement is like, if yes and yes2 and yes3 then
runs the script, while method 2 is like if yes then (checkpoint) if yes2 then (checkpoint) if yes3 then (checkpoint)
as in consequently checking if they are all accompanied to each other, as in if the first yes is true, then check if the 2nd yes is true, vise versa.
I believe if you want a more-effecient based script, i'd prefer method 2 as in consequently running check-ups while proceeding throughout the script. Like I said, the method 1 is just to check at first if all method's are true to proceed, while method 2 is checking if the first if statement is true, to proceed to second if statement and so on.
Closed as Primarily Opinion-Based by User#19524
This question has been closed because it is a discussion about a topic focused on diverse opinions, which isn't a good fit for our Q&A format.
Why was this question closed?