# Problems with \*if (var1 \> x) and (var2 \> y) #choice

**URL:** <https://forum.choiceofgames.com/t/problems-with-if-var1-x-and-var2-y-choice/1754>\
**Category:** ChoiceScript Help\
**Created:** [October 2, 2013, 2:42pm UTC](https://forum.choiceofgames.com/t/problems-with-if-var1-x-and-var2-y-choice/1754 "2013-10-02T14:42:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magma](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/magma/32/24969_2.png) [@Magma](https://forum.choiceofgames.com/u/Magma)\
**Post date:** [October 2, 2013, 2:42pm UTC](https://forum.choiceofgames.com/t/problems-with-if-var1-x-and-var2-y-choice/1754/1 "2013-10-02T14:42:42Z")

</div>

Thanks in advance for the help, the title kind of tells it all…

I want the player to be able to choose an option if two conditions hold true. First his reputation must be higher than 4 and his agility must be higher than 7.

My code is something like

\*choice  
\*if (fighter\_rep \> 4) and (agility \> 7) #I will be a gym teacher

The error message is invalid expression at characther x, found bolean operator [AND]

I then went to the choice script wiki and went over the various possible expressions and found:

And / Or / Not

In addition, it’s possible to assign two or more conditions to a single \*if statement, using and / or. Note that when checking two or more conditions simultaneously, parentheses are required to separate them, as follows:

And: \*if (var1 \> 10) and (var2 \> 20)

Which looks rather similar to what i am trying to do…

What am i doing wrong?

Once again, thanks for the support.

---

<div class="post-metadata">

**Author:** ![Caddmuss](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/caddmuss/32/424_2.png) [@Caddmuss](https://forum.choiceofgames.com/u/Caddmuss)\
**Post date:** [October 2, 2013, 2:51pm UTC](https://forum.choiceofgames.com/t/problems-with-if-var1-x-and-var2-y-choice/1754/2 "2013-10-02T14:51:58Z")

</div>

TECHNICALLY, you can only have 1 \*if requirement. You can have multiple requisites, but they have to be inside a single pair of parentheses.

For sake of time, just do this:

```

*if ((fighter_rep>4) and (agility>7)) #I will be a gym teacher

```

Edit: [Slightly more in-depth explanation I made a while back.](https://www.choiceofgames.com/forum/discussion/comment/68832#Comment_68832)

---

<div class="post-metadata">

**Author:** ![Magma](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/magma/32/24969_2.png) [@Magma](https://forum.choiceofgames.com/u/Magma)\
**Post date:** [October 2, 2013, 2:53pm UTC](https://forum.choiceofgames.com/t/problems-with-if-var1-x-and-var2-y-choice/1754/3 "2013-10-02T14:53:30Z")

</div>

Wow… that easy? I feel like a newb 😉

Thanks 🙂 much appreciated
