Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/True_end.rpy", line 479: expected statement.
elif result == "scissors":
^
if result == "paper":
u "HAHAHAHA!{nw}"
play sound "UI_Quirky33.mp3"
show rom scare:
linear 0.090 xoffset -10
linear 0.090 xoffset +0
repeat 2
$ rom_health-=15
u "[result] beats [selection], [playername]~"
elif result == "scissors":
u "HAHAHAHAHA!{nw}"
play sound "UI_Quirky33.mp3"
show ram scare:
linear 0.090 xoffset -10
linear 0.090 xoffset +0
repeat 2
$ram_health-=25
u "[result] beats [selection], [playername]~"
I've tried everything I could think of but I'm still not sure what the program is asking for.
Last edited by Gushi on Sun May 20, 2018 11:31 am, edited 1 time in total.
elif has no corresponding if statement: https://i.imgur.com/FnMsGzb.png
I think, you intended those two lines to be executed only if result equal to "paper". To do so, make sure identation is consistent to other actions in if-block
Your indentation is messed up: the two lines above your elif is at the same level as the original if block - that essentially ends your if block meaning the elif block isn't associated to the if block anymore.
Given that your code has quite a lot of duplication, you may be better off grouping the different statements together in your if block, and leave the rest out of the if block:
if result == "paper":
$ rom_health-=15
u "HAHAHAHA!{nw}"
elif result == "scissors":
$ram_health-=25
u "HAHAHAHAHA!{nw}"
play sound "UI_Quirky33.mp3"
show rom scare:
linear 0.090 xoffset -10
linear 0.090 xoffset +0
repeat 2
u "[result] beats [selection], [playername]~"