1st of all, don't think that nobody will answer after only 3 minutes. but here is an answer. you need this script.
[blocks]
<when green flag clicked>
ask codeword
<if><( answer <=> (whatever the command is) )>
<broadcast[ command
<end>[/blocks]
the ask block is located in the sensing category. the scratch team must not have updated the forum blocks.
Last edited by 16Skittles (2010-02-14 17:44:01)
Offline
If you want to make it so that the user types in a secret word, then you have to have a hat for the first letter. Following this, numerous if blocks for the keys following. For instance, if the word is 'phi,' then use this:
<when[ p ]key pressed>
<wait until><key[ any ]pressed?>
<if><key[ h ]pressed?>
|<wait until><key[ any ]pressed?>
|<if><key[ i ]pressed?>
||Code to execute if the word is entered.
|<end>
<end>
Offline
billyedward wrote:
If you want to make it so that the user types in a secret word, then you have to have a hat for the first letter. Following this, numerous if blocks for the keys following. For instance, if the word is 'phi,' then use this:
<when[ p ]key pressed>
<wait until><key[ any ]pressed?>
<if><key[ h ]pressed?>
|<wait until><key[ any ]pressed?>
|<if><key[ i ]pressed?>
||Code to execute if the word is entered.
|<end>
<end>
Scratch does not have <key[ any ]pressed?>.
Offline
MathWizz wrote:
billyedward wrote:
If you want to make it so that the user types in a secret word, then you have to have a hat for the first letter. Following this, numerous if blocks for the keys following. For instance, if the word is 'phi,' then use this:
<when[ p ]key pressed>
<wait until><key[ any ]pressed?>
<if><key[ h ]pressed?>
|<wait until><key[ any ]pressed?>
|<if><key[ i ]pressed?>
||Code to execute if the word is entered.
|<end>
<end>Scratch does not have <key[ any ]pressed?>.
Nope, you have to use a bunch of << <or> >> blocks.
Offline
Ok. My script will do you well. :
<when green flag clicked>
<forever>
<play sound[ pop]
<end>
Try it out.
Offline
My real script, Here it goes. Say the password is duck.
<when green flag clicked>
<wait until><key[d]pressed?>
<wait(.001 )secsc>
<wait until><key[u]pressed?>
<wait(.001 )secsc>
<wait until><key[c]pressed?>
<wait(.001 )secsc>
<wait until><key[k]pressed?>
<wait(.001 )secsc>
Try it out. Works for me.
Offline
juststickman wrote:
MathWizz wrote:
billyedward wrote:
If you want to make it so that the user types in a secret word, then you have to have a hat for the first letter. Following this, numerous if blocks for the keys following. For instance, if the word is 'phi,' then use this:
<when[ p ]key pressed>
<wait until><key[ any ]pressed?>
<if><key[ h ]pressed?>
|<wait until><key[ any ]pressed?>
|<if><key[ i ]pressed?>
||Code to execute if the word is entered.
|<end>
<end>Scratch does not have <key[ any ]pressed?>.
Nope, you have to use a bunch of << <or> >> blocks.
Yes, I was doing that to be lazy. You can also use an any option in Streak, though.
Offline
Lol don't tease the new person.
Use the ask question block.
When green flag clicked
Ask question (whatever you want to ask))
Forever if (<answer = Whatever your answer is>
Do whatever you want to do
Last edited by Stickman704 (2010-02-18 05:48:25)
Offline
You could just use the ask block...
Offline