Help with commands If and Elif

Hi everyone!

I wanted to know if someone knew what’s wrong with my script. I’m using the if and elif commands to display a reaction of one of the characters based on the outfit that another character chose, but when I try to play it, it doesn’t work (it just gets stuck on the previous line/action).

where is the gain for that outfit?

1 Like

Hello, dear. I think it might be because of & command. You can try to switch it with @. :confused:

Hey Sonder! Thanks I’ll check that out. :relaxed:

1 Like

@EtherealWitch Thanks! This solved it. I checked the gains and noticed I named them differently. Silly me :laughing:
Thank you lots. :relaxed:

You need to label the outfit choice, and then specify what choice the if/elif/else refers to. So your original outfit choice should look like:

choice (DINNER_OUTFIT)
“OUTFIT_DINNER_1” {
#change into outfit 1
} “OUTFIT_DINNER_2” {
#change into outfit 2
} “OUTFIT_DINNER_3” {
#change into outfit 2
}

And then in you if/elfi/else:

if (DINNER_OUTFIT is “OUTFIT_DINNER_1”) {
#outfit 1 reaction
} (DINNER_OUTFIT is “OUTFIT_DINNER_2”) {
#outfit 2 reaction
} else {
#outfit 3 reaction
}

1 Like

Thank you! I’ll do it this way. :smile:

1 Like