This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-12-21 14:25:29

Spbunny765
Scratcher
Registered: 2011-11-01
Posts: 5

How do you make things say something or something else when you click?

I'm making my Victini OS and I have a talking Victini. When you click on him,he tells you if you need an update or not. When you click on him when you don't need an update,he just says random things when you click on him,but I can't make him say random things. I don't know how. Like he says "Nice weather we're having :)" or "I feel hungry..." when you click him. Anyone know?


Haters gonna hate.
http://i1.kym-cdn.com/photos/images/original/000/383/938/115.gifhttp://th258.photobucket.com/albums/hh264/schwuuligenffm/th_spongebob.gifhttp://th461.photobucket.com/albums/qq340/richkilla54/th_BlackKyurem.gif

Offline

 

#2 2011-12-21 14:28:15

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How do you make things say something or something else when you click?

When [Sprite] clicked
If 'Upgraded needed=Yes
    Say "You need an update!"
Else
    Say "No update needed!"
End if/else


Why

Offline

 

#3 2011-12-21 15:24:42

rabbit1131
Scratcher
Registered: 2009-10-16
Posts: 1000+

Re: How do you make things say something or something else when you click?

RedRocker227 wrote:

When [Sprite] clicked
If 'Upgraded needed=Yes
    Say "You need an update!"
Else
    Say "No update needed!"
End if/else

And if you want it to be more condense...
http://i40.tinypic.com/261dqvs.gif


The Intergalactic Adventures of Revesilia! I hope you will partake in this gigantic undertaking, to build the sequel to the hit map The Adventures of Revesilia! The Intergalactic Adventures of Revesilia Map Builders Application thread! http://internetometer.com/image/35004.png

Offline

 

#4 2011-12-21 16:17:28

mcpNOVA
Scratcher
Registered: 2011-12-05
Posts: 100+

Re: How do you make things say something or something else when you click?

Drag an "if/else" block form the control's section onto your scripting area. In the <> beside the if, drag a "<>and<>" block from the operators and snap it by the if into the <>. Add a "<mouse down?>" block in the first spot in the "and" block. In the second, grab a <>=<> block from the operators section into the other spot on the "and" block. Then make a variable called.... I don't know... maybe (as said above), call it "update needed?".

There will be a round block after you make the variable that looks like (update needed?).
Snap that into the first spot on the = block. Then in the other (you don't need a block for this part) type in "yes" without the quotes. Now in the "else" part of the if/else block, put a say block and make it say "Update not needed" for however many seconds you want. Do the same inside the if part (not beside the "if", inside it) and put another say block and put "Update needed!" for however many seconds then after that make another say block under the other one you made, and type in "updating... please wait" or something like that.

Then snap on a "If <name of your sprite" clicked" hat block. if you need more help with the variables, and how they calculate the "update needed" and the "update not needed" stuff, feel free to ask me.  smile

Hope this helped!


http://i43.tinypic.com/n5fqcz.jpg

Offline

 

#5 2011-12-21 16:38:26

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: How do you make things say something or something else when you click?

If you want him to say random things:
1. Create a list, called: VictiniPhrases
2. Add all the phrases that you would like him to say in that list.
3. Put this script on the Victini Sprite:
http://img17.imageshack.us/img17/2594/randomphrase.gif

You should change the update variable to 0 when starting the project. And if you have an update, change it to 1.

That will pick a random item from the list to say.

Last edited by fg123 (2011-12-21 16:41:04)


Hai.

Offline

 

#6 2011-12-22 14:23:57

Spbunny765
Scratcher
Registered: 2011-11-01
Posts: 5

Re: How do you make things say something or something else when you click?

thanks all of you but,fg123's post was mostly what i was wanting. it'll be boring if he just says "You don't need an update!" all the time. but thanks again anyway  smile


Haters gonna hate.
http://i1.kym-cdn.com/photos/images/original/000/383/938/115.gifhttp://th258.photobucket.com/albums/hh264/schwuuligenffm/th_spongebob.gifhttp://th461.photobucket.com/albums/qq340/richkilla54/th_BlackKyurem.gif

Offline

 

#7 2011-12-22 14:36:08

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: How do you make things say something or something else when you click?

smile  Glad to help!

Have fun and good luck!


Hai.

Offline

 

#8 2011-12-22 14:47:55

Spbunny765
Scratcher
Registered: 2011-11-01
Posts: 5

Re: How do you make things say something or something else when you click?

oh and i released it today: http://scratch.mit.edu/projects/Spbunny765/2234975
tell me what you think. i'll add more later.


Haters gonna hate.
http://i1.kym-cdn.com/photos/images/original/000/383/938/115.gifhttp://th258.photobucket.com/albums/hh264/schwuuligenffm/th_spongebob.gifhttp://th461.photobucket.com/albums/qq340/richkilla54/th_BlackKyurem.gif

Offline

 

#9 2011-12-24 12:37:38

cmp8841
Scratcher
Registered: 2011-06-19
Posts: 31

Re: How do you make things say something or something else when you click?

You need a variable. If the variable = update, say blablabla... If variable = noupdate, say the random stuff

Offline

 

Board footer