# Help with if command

**URL:** <https://forum.choiceofgames.com/t/help-with-if-command/86666>\
**Category:** ChoiceScript Help\
**Tags:** tips\
**Created:** [September 21, 2020, 11:16pm UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666 "2020-09-21T23:16:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Acarr](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@Acarr](https://forum.choiceofgames.com/u/Acarr)\
**Post date:** [September 21, 2020, 11:16pm UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666/1 "2020-09-21T23:16:11Z")

</div>

Hi,

I’m really new to this//coding in general, but this is driving me up the wall.

Is it possible to use if/else choices to create alternate display texts? I thought it was, but whenever I try it just skips to the first “if” option regardless of what the stats are.

I’ve been trying to set it so that if you have a high enough stat in one category, you’ll get alternate scenes.

I think it might have something to do with the way my stats are set up, but I’m not sure. It’s a percentage stat, so I don’t know if I can do the (\*create example true) variable that I’ve been seeing.

* * *

Currently my coding is:

\*if Wilder\_romance \>15  
Wilder clears ${pronoun2} throat nervously

“Well, um…” A small smile curls at the corner of my mouth. It’s very rare to see Wilder genuinely flustered, and I always appreciate the sight.

“Would you like to dance,” I ask {pronoun3}, reaching out a hand for him to take. If I'm not mistaken, I think I see the tips of Wilder's ears turn red. !{pronoun} runs a hand through ${pronoun2} hair nervously.

Accepting my extended hand, Wilder delicately puts {pronoun2} right hand in my left, and places {pronoun2} other hand on my waist.  
\*goto Boom

\*else  
Wilder clears ${pronoun2} throat, slightly uncomfortable.

“Well, ${title}. Has anyone caught your eye yet?”

I smile at the teasing tone in Wilder’s voice. It’s pleasant to hear someone talk to me so casually after an evening full of rigid formality.  
\*goto Boom

* * *

If anyone can help, I would appreciate it. I have the first chapter almost finished, but mentally I can’t move on until I get this solved.

---

<div class="post-metadata">

**Author:** ![Gower](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/gower/32/21972_2.png) [@Gower](https://forum.choiceofgames.com/u/Gower)\
**Post date:** [September 21, 2020, 11:22pm UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666/2 "2020-09-21T23:22:37Z")

</div>

If you use the \</\> button, just above where you are typing here, you can format your code so we can see if you are indenting properly.

When you create a numerical variable, it must be created as a numerical variable like this:

\*create example 0

rather than

\*create example true

Also, as a side note–careful not to do “{pronoun3}” but instead do ${pronoun3}–I saw a few of those in your code above.

---

<div class="post-metadata">

**Author:** ![Acarr](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@Acarr](https://forum.choiceofgames.com/u/Acarr)\
**Post date:** [September 21, 2020, 11:32pm UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666/4 "2020-09-21T23:32:57Z")

</div>

Thank you!!!

---

<div class="post-metadata">

**Author:** ![greendaisy](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/greendaisy/32/97527_2.png) [@greendaisy](https://forum.choiceofgames.com/u/greendaisy)\
**Post date:** [September 21, 2020, 11:33pm UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666/5 "2020-09-21T23:33:45Z")

</div>

You’re missing your parentheses and a couple of spaces are off should be most of the issue:

```
*if (Wilder_romance > 15)
 Wilder clears ${pronoun2} throat nervously

 “Well, um…” A small smile curls at the corner of my mouth. It’s very rare to see Wilder genuinely flustered, and I always appreciate the sight.

 “Would you like to dance,” I ask ${pronoun3}, reaching out a hand for him to take. If I'm not mistaken, I think I see the tips of Wilder's ears turn red. $!{pronoun} runs a hand through ${pronoun2} hair nervously.

 Accepting my extended hand, Wilder delicately puts ${pronoun2} right hand in my left, and places ${pronoun2} other hand on my waist.
*goto Boom

*else
 Wilder clears ${pronoun2} throat, slightly uncomfortable.

 “Well, ${title}. Has anyone caught your eye yet?”

 I smile at the teasing tone in Wilder’s voice. It’s pleasant to hear someone talk to me so casually after an evening full of rigid formality.
*goto Boom

```

---

<div class="post-metadata">

**Author:** ![Gower](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/gower/32/21972_2.png) [@Gower](https://forum.choiceofgames.com/u/Gower)\
**Post date:** [September 21, 2020, 11:34pm UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666/6 "2020-09-21T23:34:30Z")

</div>

You don’t actually need those parentheses.

`*if Wilder_romance > 15`

works totally fine. It’s not a terrible habit to get in, and you will need them when you get into testing multiple variables, but for one variable, you don’t need them.

---

<div class="post-metadata">

**Author:** ![cup\_half\_empty](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cup_half_empty/32/273983_2.png) [@cup\_half\_empty](https://forum.choiceofgames.com/u/cup_half_empty)\
**Post date:** [September 21, 2020, 11:52pm UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666/7 "2020-09-21T23:52:19Z")

</div>

> [@Acarr](#):
>
> him

I think this should be `${pronoun2}`

---

<div class="post-metadata">

**Author:** ![Acarr](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@Acarr](https://forum.choiceofgames.com/u/Acarr)\
**Post date:** [September 22, 2020, 12:30am UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666/8 "2020-09-22T00:30:39Z")

</div>

Whoops. Yeah I have a lot of little things like that I need to clean up, I started writing the plot before I began working on the code,

---

<div class="post-metadata">

**Author:** ![Acarr](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@Acarr](https://forum.choiceofgames.com/u/Acarr)\
**Post date:** [September 22, 2020, 12:30am UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666/9 "2020-09-22T00:30:41Z")

</div>

Thank you so much!!! This fixed it!

---

<div class="post-metadata">

**Author:** ![will](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/will/32/132033_2.png) [@will](https://forum.choiceofgames.com/u/will)\
**Post date:** [September 22, 2020, 4:08am UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666/10 "2020-09-22T04:08:08Z")

</div>

```
*if (Wilder_romance > 15)
  Wilder clears ${pronoun2} throat nervously

  “Well, um…” A small smile curls at the corner of my mouth. It’s very rare to see Wilder genuinely flustered, and I always appreciate the sight.

  “Would you like to dance,” I ask ${pronoun3}, reaching out a hand for him to take. If I'm not mistaken, I think I see the tips of Wilder's ears turn red. $!{pronoun} runs a hand through ${pronoun2} hair nervously.

  Accepting my extended hand, Wilder delicately puts ${pronoun2} right hand in my left, and places ${pronoun2} other hand on my waist.
  
  *goto Boom

*else
  Wilder clears ${pronoun2} throat, slightly uncomfortable.

  “Well, ${title}. Has anyone caught your eye yet?”

  I smile at the teasing tone in Wilder’s voice. It’s pleasant to hear someone talk to me so casually after an evening full of rigid formality.

  *goto Boom

```

Fixing a couple indents in this example. You’ll get a “can’t fall out of if/else statement” error otherwise.

By the way I really like your style of writing from the example here!

---

<div class="post-metadata">

**Author:** ![Acarr](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@Acarr](https://forum.choiceofgames.com/u/Acarr)\
**Post date:** [September 22, 2020, 6:38pm UTC](https://forum.choiceofgames.com/t/help-with-if-command/86666/11 "2020-09-22T18:38:37Z")

</div>

Thank you! I’m really enjoying this project, I hope I keep working on it.
