I need Help on If/Elise/else statements and the choice code

What I’m trying to do for my story is have a locked choice button unlock after you click on an other choice button. I’ve seen it before but I can’t figure out how you do it. Can some one explain/help me on how I do this, plz?

1 Like

Heya! The if/elif/else choice commands are like this:

Branching based on past choices

Once you have set a variable you can later have the user see different parts of the story based on what the variable was set to. In the example below the user will not see any choices but instead the dialog they see will be based on what they chose as their favorite color previously in the story.

            YOU

    Hi Tyler. Is that present for me?

            TYLER

    Yup. Open it!

if (fav_color is “Pink”) {

            YOU

    A pair of pink bunny ears!

    So soft!

    Thanks! I love it.

} elif (fav_color is “Green”) {

            YOU

    A $20 bill?

            TYLER

    Yeah I didn’t know what else to get.

    It’s green at least!

} else {

            YOU

    It’s empty.

            TYLER

    Black is the absence of light.

    Darkness is emptiness

            YOU

    ...

            TYLER

    I thought you would like the metaphor.

}

For more on branching, see Complex Branching.

Helpful Video

So maybe you can do it like this:
if (unlock) {

[unlocked choice here]

} else {

[locked choice here]

}
I hope it helps :blush:

1 Like

Your method worked! thanks for helping me with this!:blush::heart:

1 Like

You’re my first solution :smile: Thank you i’m honoured and glad it worked :sparkling_heart:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.