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

#1 2008-12-19 12:29:34

ClubJN
Scratcher
Registered: 2008-10-02
Posts: 21

Money

Ok, invariables where you can make things like health or money, how do I give an error message to the user when the bar drops to 0?


ClubJN Owner!

Offline

 

#2 2008-12-19 12:32:09

zawicki1fromyoutube
Scratcher
Registered: 2008-07-31
Posts: 1000+

Re: Money

<if> <( <{ Money }> <=> 0 )>
<say[ You can't by that!


|Call Of Duty: Black Ops Wii Friend Code: 3519-4456-0013|
|Follow me on Twitter|Subscribe To My Youtube Channel

Offline

 

#3 2008-12-19 12:38:27

ClubJN
Scratcher
Registered: 2008-10-02
Posts: 21

Re: Money

When I do that though, it still takes the cash of the player, what should I do?


ClubJN Owner!

Offline

 

#4 2008-12-19 12:44:50

zawicki1fromyoutube
Scratcher
Registered: 2008-07-31
Posts: 1000+

Re: Money

Make a buying script. so say my script for buying something is:
<when green flag clicked>
<forever>
<if> <( <{ Money }> <>> 0 )>
<change{ Money }by( -10

That would be wrong. You must make a broadcast. So do like
<when[ bouncyball ]clicked>
<broadcast[ toy ball

then,

<when I receive[ toy ball
<if> <( <{ Money }> <>> 5 )>
<change{ Money }by( -5
<end>


|Call Of Duty: Black Ops Wii Friend Code: 3519-4456-0013|
|Follow me on Twitter|Subscribe To My Youtube Channel

Offline

 

#5 2008-12-19 12:52:04

ClubJN
Scratcher
Registered: 2008-10-02
Posts: 21

Re: Money

Thanks, That works now.


ClubJN Owner!

Offline

 

Board footer