create a function, put your entire script block in it, and under the script for when you get it wrong, use~add the 'call function' Script, and type in the name of your function (this will do the function over again, aka 'looping' it).
an example (in code, as it's easier and faster for me):
<object name="pass_code_box">
<inherit name="editor_object" />
<attr name="input_pass_code_buttons" type="script">
input_pass_code_buttons_function // calls the function ( 'call function' script )
</attr>
<attr name="displayverbs" type="listextend">input_pass_code_buttons</attr>
</object>
<function name="input_pass_code_buttons_function">
msg ("What is the pass code?")
get input {
if (result = "6392") {
// open and~or unlock door scripts
msg ("The door opens, you inputted the correct pass code")
ClearScreen
} else {
msg ("wrong pass code, try again")
ClearScreen
input_pass_code_buttons_function // calls the function ( 'call function' script), thus 'looping' the function, if you put in the incorrect input
}
}
</function>
------
there's also:
invoke (Object.Script_Attribute)
<object name="pass_code_box">
<inherit name="editor_object" />
<attr name="input_pass_code_buttons" type="script">
msg ("What is the pass code?")
get input {
if (result = "6392") {
// open and~or unlock door scripts
msg ("The door opens, you inputted the correct pass code")
ClearScreen
} else {
msg ("wrong pass code, try again")
ClearScreen
invoke (pass_code_box.input_pass_code_buttons) // calls (invokes) the script, thus 'looping' the script, if you put in the incorrect input
}
}
</attr>
<attr name="displayverbs" type="listextend">input_pass_code_buttons</attr>
</object>
but functions are better as they allow for parameters (which you'll use later as you learn more).