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

#1 2008-09-26 18:32:35

Marine43753
Scratcher
Registered: 2008-08-25
Posts: 16

How do make it so when im out of amunition my target dosent die?

answer subject!

Offline

 

#2 2008-09-26 18:44:12

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: How do make it so when im out of amunition my target dosent die?

Make a variable called "ammo" (the name doesn't matter, so call it whatever you want). Then make a script like this:
<when green flag clicked>
<set{ ammo }to( 20
NOTE: you don't need to set it to 20. That number is the amount you start with.
Then, in the script for shooting, insert this:
*shooting script*

<change{ ammo }by( -1
Now, surround this block around the shooting and ammo changing script:

<if><not><( <{ ammo }> <=> 0 )> >>
*scripts here*
<end>

That way it won't shoot when you're out of ammo.

Last edited by hmnwilson (2008-09-26 18:47:04)


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#3 2008-10-01 11:52:44

Marine43753
Scratcher
Registered: 2008-08-25
Posts: 16

Re: How do make it so when im out of amunition my target dosent die?

never mind I figured it out myself. thanks anyway!

Offline

 

Board footer