Bloody_riko
Bloody_riko

Reputation: 1

Renpy ‘break’ outside loop

Im trying to make a insert name but i keep on getting “ ‘break’ outside loop”

label start:

    scene black 
    
    python:
        while True:
            name = renpy.input("{b}Insert your name{b}")
        if name.strip() == "":
            me = Character("Levi", color="#00a2d3", who_outlines=[(3, "#afecff", 1, 1)],who_xpos= 600,  who_ypos= 20)
            break
            #narrator(_("Please insert a name"))
        elif len(name.strip()) > 20:
            narrator(_("This name is too long..."))
        else:
            me = Character(name.strip(), color="#00a2d3", who_outlines=[(3, "#afecff", 1, 1)],who_xpos= 600,  who_ypos= 20)
            break

I try everything I know I slit get the same result, can I get and help?

Upvotes: -7

Views: 83

Answers (1)

Timsib Adnap
Timsib Adnap

Reputation: 541

There is an indentation problem in the python code. This should be the right one.

label start:

    scene black 
    
    python:
        while True:
            name = renpy.input("{b}Insert your name{b}")
            if name.strip() == "":
                me = Character("Levi", color="#00a2d3", who_outlines=[(3, "#afecff", 1, 1)],who_xpos= 600,  who_ypos= 20)
                break
                #narrator(_("Please insert a name"))
            elif len(name.strip()) > 20:
                narrator(_("This name is too long..."))
            else:
                me = Character(name.strip(), color="#00a2d3", who_outlines=[(3, "#afecff", 1, 1)],who_xpos= 600,  who_ypos= 20)
                break

Upvotes: 1

Related Questions