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

#1 2013-02-11 04:33:37

Bombguy2010
New Scratcher
Registered: 2013-02-08
Posts: 17

Variable and script help needed

How do you make it that you can not run a section of script if it will bring a variable down to below zero?

Thanks

Offline

 

#2 2013-02-11 14:11:28

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Variable and script help needed

Wait. So if the variable is lower than 0, don't run?
Or if the script will lower the variable lower than 0, don't run?

They're fairly different.

Offline

 

#3 2013-02-12 03:50:27

Bombguy2010
New Scratcher
Registered: 2013-02-08
Posts: 17

Re: Variable and script help needed

I want it that if the script will lower the variable lower than 0, don't run.

Offline

 

#4 2013-02-12 03:53:43

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Variable and script help needed

okay, let's see. you'll have to know how much the script will change the variable by. lets call that x.

if not (var < x)
----run script

if you don't know x, I'll have to see the code to write the script.

Offline

 

Board footer