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

#1 2009-04-09 17:51:34

rockerdude
Scratcher
Registered: 2008-03-19
Posts: 21

I Have A Question

How Do You Make It So When You Click On A Button Or Something, The Button Says Yes Or No Depending On How Much Money You Have. Ex: I Want To Buy A Pet (on Scratch) For $60, And I Have 70 How Do You Make It So That If You Have 60 Dollars Or *more* Keyword: *more*... It Will Let You Buy It?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!!?

Last edited by rockerdude (2009-04-09 17:51:55)


cool

Offline

 

#2 2009-04-09 17:59:01

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Re: I Have A Question

Use different costumes for the buttons... one for Yes, one for No.

Then, in the button's scripts, put some sort of check:

If (UsersMoney > 60)
switch to costume (yes)
else
switch to costume (no)

Then, in the button's click event code, check to see which action should be taken depending on how much money the person has:

When button clicked
If (UsersMoney > 60)
Add (this item) to (users inventory list)
Change (UsersMoney) by (-60)
else
...

Hope this helps!

Last edited by BoltBait (2009-04-09 18:00:20)


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

#3 2009-04-09 18:03:48

rockerdude
Scratcher
Registered: 2008-03-19
Posts: 21

Re: I Have A Question

OMG OMG OMG OMG OMG OMG I SO KNEW THAT!!!!!!!!!!!!!!!! HOLY CRUD HOW DID I MISS THAT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I ALWAYS USE THAT TECHNIQUE!!!!!!!!!!!!!!!!!!!!!!!!!!!! But i know why i forgot it! I started this game a LOOOOOOOOOOOOONG time ago, and now I'm trying to finish it. BUT WITHOUT YOU I WOULD OF FORGOT!!!!!!!!!!!! THANKS SSOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO MUCH!!!!!!!!


cool

Offline

 

#4 2009-04-09 18:10:35

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Re: I Have A Question

You're welcome.

Glad to be of service.


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

Board footer