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

#1 2009-11-28 15:59:57

Sonicloon
Scratcher
Registered: 2009-10-03
Posts: 1

Problem...

Hi, this is my first post also but so what?  tongue  So I'm making a PSG1 simulation like colj00 (big fan), but I can't get the script for not shooting when the variable Ammo is 0. I've got:
[blocks]
<when[ space ]key pressed>
<change{ Ammo }by( -1
<forever>
<if><( <{ Ammo }> <=> 0 )>
<else>
<end>
But I don't know exactly what to put in the spaces :L Need help!!!

Offline

 

#2 2009-11-28 16:35:23

DawnLight
Scratcher
Registered: 2009-04-25
Posts: 500+

Re: Problem...

Sonicloon wrote:

Hi, this is my first post also but so what?  tongue  So I'm making a PSG1 simulation like colj00 (big fan), but I can't get the script for not shooting when the variable Ammo is 0. I've got:
[blocks]
<when[ space ]key pressed>
<change{ Ammo }by( -1
<forever>
<if><( <{ Ammo }> <=> 0 )>
<else>
<end>
But I don't know exactly what to put in the spaces :L Need help!!!

Don't fill in all the spaces. What you have to do it set the Variable to 1 in the Else. Hope that helps!

Offline

 

#3 2009-11-28 17:23:37

NiteHaunt
Scratcher
Registered: 2009-11-21
Posts: 39

Re: Problem...

I have made a demo like this...

Or You can do:
[blocks]


<if>     ammo = 0 or ammo = >0     

[/blocks]


That may help.
<end>

Offline

 

Board footer