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

#1 2011-10-04 16:43:28

anex1496
New Scratcher
Registered: 2011-01-05
Posts: 1

Is there a way to make it so it only adds to variable once?

I have a sprite that adds 100 points when the player touches it, is there a way to make it so it doesn't keep adding 100 to the variable? It looks something like this: [blocks]<when I receive[ go inside home <touching[hero <if><change{rupees  }by( 100 [/blocks]

Offline

 

#2 2011-10-04 16:45:25

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: Is there a way to make it so it only adds to variable once?

You could try adding a [wait until <not <touching [Hero]> > ] to it.  smile


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#3 2011-10-04 16:47:58

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Is there a way to make it so it only adds to variable once?

Add

Code:

[wait until <not <touching [hero]>>]

Ninja'd by the 60 second rule! And here! Just 00:02:02 apart.  yikes

Last edited by scimonster (2011-10-04 16:49:14)

Offline

 

#4 2011-10-04 19:33:38

laptop97
Scratcher
Registered: 2011-06-27
Posts: 1000+

Re: Is there a way to make it so it only adds to variable once?

scimonster wrote:

Add

Code:

[wait until <not <touching [hero]>>]

Ninja'd by the 60 second rule! And here! Just 00:02:02 apart.  yikes

Listen to the above posts  smile

I got a post in under a second of someone else [/offtopic]

Offline

 

#5 2011-10-04 23:20:01

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

Re: Is there a way to make it so it only adds to variable once?

I was about to answer  sad  Anyway, is this an All About Scratch topic?


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

Offline

 

Board footer