# Question: Can I use if variables within text?

**URL:** <https://forum.choiceofgames.com/t/question-can-i-use-if-variables-within-text/34647>\
**Category:** ChoiceScript Help\
**Created:** [January 25, 2018, 2:19am UTC](https://forum.choiceofgames.com/t/question-can-i-use-if-variables-within-text/34647 "2018-01-25T02:19:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SparklingCrow](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/sparklingcrow/32/46379_2.png) [@SparklingCrow](https://forum.choiceofgames.com/u/SparklingCrow)\
**Post date:** [January 25, 2018, 2:19am UTC](https://forum.choiceofgames.com/t/question-can-i-use-if-variables-within-text/34647/1 "2018-01-25T02:19:32Z")

</div>

I’m having trouble with… Is it possible to use variables within a block of text?  
I want the conversation to be slightly different depending on which character you’re playing.

The error I’m getting is:… invalid expression, couldn’t extract another token

My code looks like this:

```
#Say “You know… stuck in a creepy house.”
          The twins burst out laughing.

          *if (jack) Apparently, they think you're kidding.

```

I get that I could just make 2 identical choices, one for if jack, one else; then have them go to two slightly different versions of the conversation before rejoining the main stream.

Maybe I’m using the wrong command?

TL;DR How do I change part of a text block with variables?

Thank you. Sorry if it’s already answered, I did a cursory search and couldn’t find anything.

---

<div class="post-metadata">

**Author:** ![UmbraLamia](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/umbralamia/32/9516_2.png) [@UmbraLamia](https://forum.choiceofgames.com/u/UmbraLamia)\
**Post date:** [January 25, 2018, 2:21am UTC](https://forum.choiceofgames.com/t/question-can-i-use-if-variables-within-text/34647/2 "2018-01-25T02:21:51Z")

</div>

```
*if Jack
    Apparently, they think you're kidding.

```

This should work. Basically, it needs to be on the _next_ line, and indented.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [January 25, 2018, 5:45am UTC](https://forum.choiceofgames.com/t/question-can-i-use-if-variables-within-text/34647/3 "2018-01-25T05:45:40Z")

</div>

You can do this

```
#Say “You know… stuck in a creepy house.”
          The twins burst out laughing.

          *if (jack)
                    Apparently, they think you're kidding.
          *else
                    hblahbalbalakajalah
```

---

<div class="post-metadata">

**Author:** ![SparklingCrow](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/sparklingcrow/32/46379_2.png) [@SparklingCrow](https://forum.choiceofgames.com/u/SparklingCrow)\
**Post date:** [January 25, 2018, 10:49pm UTC](https://forum.choiceofgames.com/t/question-can-i-use-if-variables-within-text/34647/4 "2018-01-25T22:49:25Z")

</div>

Thank you! That worked perfectly.  
@Szaal  
@UmbraLamia  
🤗

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [January 26, 2018, 4:11pm UTC](https://forum.choiceofgames.com/t/question-can-i-use-if-variables-within-text/34647/6 "2018-01-26T16:11:27Z")

</div>

If ever want something inline (inside the choice option) you can also use multi replace:

```
#Say, you're a @{is_police cop|robber}, right?
```

---

<div class="post-metadata">

**Author:** ![Carlos.R](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/carlos.r/32/75837_2.png) [@Carlos.R](https://forum.choiceofgames.com/u/Carlos.R)\
**Post date:** [January 26, 2018, 7:14pm UTC](https://forum.choiceofgames.com/t/question-can-i-use-if-variables-within-text/34647/7 "2018-01-26T19:14:59Z")

</div>

```
#Jack and Jill went up the hill to fetch a pail of @{is_drunk water|booze}.

```
