How do I add 2 "if"s to 1 event

Started by poolcool2 on Thu, 01/25/2018 - 03:51

Topic category: Help with MCreator software

Last seen on 19:39, 18. Sep 2019
Joined Jan 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How do I add 2 "if"s to 1 event
Thu, 01/25/2018 - 03:51

My goal was to make it so if a variable was true and a random number was selected it would do something using events

I tried "isVariableTrue[<Variable name>],(int)(Math.random()*2)=2"

and "isVariableTrue[<Variable name>];(int)(Math.random()*2)=2"

and ""isVariableTrue[<Variable name>]" + "(int)(Math.random()*2)=2""

all of them gave errors and I ran out of ideas to try, I looked all over and it seems nobody had the same question and the wiki never mentioned this

I replaced where I had the variable with "<Variable name>" as to not spoil my project

I also have not found a way to get around this problem but it seems impossible without having 2 "if"s

Last seen on 11:41, 17. Oct 2020
Joined Jun 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Try to use a stack event…
Thu, 01/25/2018 - 08:41

Try to use a stack event instead of using only an event for both conditions

Last seen on 19:39, 18. Sep 2019
Joined Jan 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I don't fully understand…
Thu, 01/25/2018 - 14:46

I don't fully understand what you mean

Last seen on 19:22, 21. Oct 2020
Joined Apr 2010
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You select stack event event…
Thu, 01/25/2018 - 17:54

You select stack event event result and add the first condition and then on the stacked event, add another condition and desired event result.

We plan to include logical expressions in condition field in the future.

Last seen on 19:39, 18. Sep 2019
Joined Jan 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Ok thanks
Thu, 01/25/2018 - 19:53

Ok thanks