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

#1 2011-08-04 22:12:10

babbet
Scratcher
Registered: 2011-07-23
Posts: 100+

how do you make a random button

i have a game I'm making and would love it if you guys could tell how to make a button that picks random 1 to 9

i know there is one of those in "operators but you need to attach it someplace and i don't know what that someplace is.


https://lh3.googleusercontent.com/-SBVvDiIX0PY/Tm6OBd27mnI/AAAAAAAABR4/b--gXKoPlkU/babbet400x150.jpg

Offline

 

#2 2011-08-04 22:29:36

JJROCKER
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: how do you make a random button

Say if (Something equals something)(Pick random 1 to 9) Upload the project so maybe I can help.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://img255.imageshack.us/img255/3491/signature1y.jpg&link2=http://img577.imageshack.us/img577/5272/signature1sx.jpg&link3=http://img4.imageshack.us/img4/8514/signature1et.jpg&link4=http://i.imgur.com/POEpQyZ.png&link5=http://img163.imageshack.us/img163/4640/jjrockerfinal.jpg

Offline

 

#3 2011-08-05 11:57:53

PlutoIsHades
Scratcher
Registered: 2010-10-18
Posts: 1000+

Re: how do you make a random button

Try this:

When Button clicked
Pick random 1 - 9


Minecraft, Redwall, and Cyberchase fan, and PROUD.

Offline

 

#4 2011-08-09 10:46:51

4lover
Scratcher
Registered: 2010-04-24
Posts: 500+

Re: how do you make a random button

Ill make this alot simpler <when[ sprite 1 ( also known as the button ]clicked><pick random( 1 )to( 9


Check out this awesome new zombie-cod type of game: http://scratch.mit.edu/projects/4lover/1975649

Offline

 

#5 2011-08-09 18:29:33

focuspunchpoliwrath
Scratcher
Registered: 2010-11-27
Posts: 2

Re: how do you make a random button

<when green flag clicked><say[ why am i at this fourm?

Offline

 

#6 2011-08-09 19:16:02

a1130
Scratcher
Registered: 2009-08-27
Posts: 500+

Re: how do you make a random button

You could do this:

{when button clicked}
[say ((pick random (1) to (9)))]

or

{when button clicked}
[set (variable name) to ((pick random (1) to (9)))]

Offline

 

#7 2011-08-09 22:57:12

4lover
Scratcher
Registered: 2010-04-24
Posts: 500+

Re: how do you make a random button

thats the same thing I said


Check out this awesome new zombie-cod type of game: http://scratch.mit.edu/projects/4lover/1975649

Offline

 

#8 2011-08-11 15:03:08

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: how do you make a random button

when button clicked pick random 1 to 9


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#9 2011-08-11 18:13:48

a1130
Scratcher
Registered: 2009-08-27
Posts: 500+

Re: how do you make a random button

4lover wrote:

thats the same thing I said

I added a "say" block. The "pick random" itself isn't a block. It has to be inserted into a text field, similar to how you can insert things into "if" blocks.

Offline

 

#10 2011-08-12 17:18:12

babbet
Scratcher
Registered: 2011-07-23
Posts: 100+

Re: how do you make a random button

thanks for everybody who helped


https://lh3.googleusercontent.com/-SBVvDiIX0PY/Tm6OBd27mnI/AAAAAAAABR4/b--gXKoPlkU/babbet400x150.jpg

Offline

 

#11 2011-08-12 18:28:36

LordSydney
Scratcher
Registered: 2011-04-20
Posts: 100+

Re: how do you make a random button

babbet wrote:

thanks for everybody who helped

You will find the Scratch community very helpful, so if you need help, don't be afraid to ask! Also another great resource tool is the Scratch Wiki, "Made by Scratchers, for Scratchers."


Need help with BBCode?
http://i.imgur.com/IfWrL.gifAlso check this out!http://i.imgur.com/YgF2v.gif

Offline

 

Board footer