Help with entering an alphabetic code

I figured out how to have someone enter a number to satisfy a condition to make something happen. For example, once they put in the proper number code here, they get access to a key.

How do I do this where they enter a word to satisfy a condition? For example, enter a keyword to open a door.

Thanks

2 Likes

this is really cool! Can you make it remixable so I can check out your code?

1 Like

Done. Thank you for doing this.

1 Like

The easiest way is creating keyboard and I see that in your example you have already implemented 3d keys for all letters!

1 Like

But it only works for numbers. Putting in the right number code opens the cabinet. I can’t get it to open if you put in the right alphabetic code.

1 Like

I made a converter, which takes the letter keys and assigns a number to them, and that works, but why doesn’t the alpha work?

Thanks

1 Like

The alpha doesn’t work because you compare the variable with string literals with “2”. If you change the comparison to string with letters, it would work

1 Like

I know there is a 2 in there. I can’t change it to anything alpha. It keeps reverting to my previous entry of 2.

1 Like

You can take a string block from the “Data” category and then you will be able to edit the string:

1 Like

That does it. Thanks so much!

1 Like

My only other issue is that students sometimes mistype their names, and have to start over. How can I have a reset button reset the string? Thanks.

You could add a © button that sets the entered string to “”

1 Like

I tried, but it didn’t work

Thanks

1 Like

I have changed the resetting strings code and now it works:

Please, feel free to remix the updated project here:

1 Like

Thank you! That did it! Good job.

https://edu.cospaces.io/AYB-QRK

1 Like

Thanks for the comments from everyone, I also tried it and felt happy to learn more from everyone, thank you very much.

1 Like

About this, may you do a tutorial or something? I am really confused. :sweat_smile:

1 Like