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

#1 2010-07-04 12:27:58

Gveradux
Scratcher
Registered: 2010-06-18
Posts: 100+

Variable Help

I want a script

e.g.

If I had two packets of crisp, if I entered a number over 2, it wouldn't sell.

Can I have a script for that?

Offline

 

#2 2010-07-04 12:59:28

MaxtheWeirdo
Scratcher
Registered: 2010-03-18
Posts: 500+

Re: Variable Help

if number of item < amount to sell
say "You don't have enough items."
end

That should work.


My website. Hall Crawler My Awesome OS
It's just marketing, guys! Nothing sinister!

Offline

 

#3 2010-07-04 14:54:09

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Variable Help

Yep - MaxtheWeirdo's solution should work great!

If you're planning on having something happen if it is possible to sell correctly, use an "If... else" script and put what will happen if it works fine in the "else" part of the script.

Offline

 

Board footer