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

#1 2010-09-18 18:29:00

MachoWalrus
Scratcher
Registered: 2010-09-17
Posts: 9

Quick! Variable Question!

How do I script to make something happen if there is a certain variable? Like, I need a death screen to appear when the health variable is 0? I need to know Really soon!

Offline

 

#2 2010-09-18 20:06:31

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Quick! Variable Question!

Try making a sprite for the death screen and giving it the below script:

When Flag Clicked
hide
wait until variable = 0
show


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#3 2010-09-19 06:43:43

MachoWalrus
Scratcher
Registered: 2010-09-17
Posts: 9

Re: Quick! Variable Question!

That' what I did. I can't find a variable = thing though.

Offline

 

#4 2010-09-19 09:07:30

mathematics
Scratcher
Registered: 2009-03-01
Posts: 1000+

Re: Quick! Variable Question!

[blocks]<when green flag clicked>
<hide>
<wait until> <( <{ variable }> <=> 0 )>
<show>[/blocks]

This is how you do it.

Last edited by mathematics (2010-09-19 09:09:00)

Offline

 

#5 2010-10-31 00:56:05

hgsaf5
New Scratcher
Registered: 2010-10-30
Posts: 1

Re: Quick! Variable Question!

hey

Offline

 

Board footer