Hello,
I'm trying to make a the player enter a password into a text box when they try to use a door to be able to progress in the game.
I've made a GUI with a text box as described in the PDF guide and in an earlier forum post back in January. This duly appears when the player interacts with the door, but doesn't give the player time to enter anything before the next thing happens - it goes straight to the "wrong password" type response.
I have tried setting my GUI properties to both "pause game when shown" and "normal, initially off", but this makes no difference. Do I need to block something somewhere?
Here is what I've done, forgive me if it doesn't look too nice, I'm new to this.
function hBathdoor_Interact()
{
cDoorvoice.Say("What's the password?");
gPassword.Visible=true;
if (TextBox1.Text=="cheese"){
cDoorvoice.Say("Come on in.");}
else {cDoorvoice.Say("Nope.");
}
TextBox1.Text="";
}
What haven't I done? Thanks a lot for your help.
Em
I'm trying to make a the player enter a password into a text box when they try to use a door to be able to progress in the game.
I've made a GUI with a text box as described in the PDF guide and in an earlier forum post back in January. This duly appears when the player interacts with the door, but doesn't give the player time to enter anything before the next thing happens - it goes straight to the "wrong password" type response.
I have tried setting my GUI properties to both "pause game when shown" and "normal, initially off", but this makes no difference. Do I need to block something somewhere?
Here is what I've done, forgive me if it doesn't look too nice, I'm new to this.
function hBathdoor_Interact()
{
cDoorvoice.Say("What's the password?");
gPassword.Visible=true;
if (TextBox1.Text=="cheese"){
cDoorvoice.Say("Come on in.");}
else {cDoorvoice.Say("Nope.");
}
TextBox1.Text="";
}
What haven't I done? Thanks a lot for your help.
Em