I need help with my coding (if/elif else)

So i think i did it wrong? even when i have more bad girls points i end up getting the good girl ending??? can anyone help pls

@Dara.Amarie i hope u dont mind me tagging

Remove the blank line 11238 :slight_smile:

Also you can just write “else” instead of elif

theres 3 endings sorry , i didnt include the last one , theres a good girl ending, bad girl ending and a mixed ending. and even if i have more bad girl points i end up getting the good girl ending

I know this might sound weird, but the code can be very finicky…

Make sure you format it like this:


So you put a space between the arrow and the first word but not one after the arrow if you get what I mean. See if that works :slight_smile:

And obviously repeat it for each if command. Also a good way to test it to make sure it works in the previewer is to put into your script a fabricated number like this BEFORE the if else command:


And remove it after you tested it as if you havent collected the points in that episode you are texting, you wouldnt have gained the points to begin with if that makes sense :joy: sometimes if you test your script and havent gained any points in the scenes you’ve tested you havent gained any points to give you different endings so the code doesn’t work properly.

Obv to test different paths you can make good girl points more than bad girl points to make sure it works!

it didnt work But thank uuu :))

I just edited my previous message, try that to see if you can test it like that.

hmm it seems to be working on my pc but then i try to preview it on my phone and it doesnt work :thinking:

Silly question but have you updated the script on your phone?

hmmm i think so but if not how do i do that?

You’ll find it on the left hand side of your screen on one of the buttons it will say something like “Update Script” or you can go to navigation and Reset the episode.

yeah i did it and it still doesnt work. idk why everything seems fine

Hmm, if it works in the portal but not the app that’s really strange. Maybe file a support ticket or reset your app?

yeah its weird idk why its not working but thank u for ur help anyway!!!

#More good girl points branch here.
#More bad girl points branch here.
#Even points branch here.

You could try that.^ :see_no_evil:

1 Like

I’m not sure if it will work but when I use an if/elif/else code, I write like this:
…(Ending for good girl)
… (ending for bad girl)
} else {
… (ending for equal points)
See if putting the spaces work for you.

1 Like

hmm still doesn’t work for some reason :thinking:

u know what’s weird. is that in the second chapter i have copy and pasted the ending from the first chapter . and it works perfectly in the second chapter but it’s messed up in the first :thinking: i’m going to try and check my code tomorrow to see where i must’ve messed up in the first chapter

1 Like

That is weird. :thinking:

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