In my game this is how its suposed to go.
When i dont have cheese puffs in my inventory and i click on a certain person they say one thing.
When i do have cheese puffs in my inventory that certain person says something eslse and a sprite appears.
Ive been trying to figure something out for this but everthing i try messes up. Anyone have any ideas?
Offline
I'm assuming that the inventory is a list. If not, ignore what follows
Here's the script:
//On the sprite that speaks... When person clicked if <[inventory] contains [cheese puffs]> say "You have cheese puffs in your inventory!" broadcast [showSprite] else says "Sorry, no cheese puffs here!" end //And on the sprite that shows if you do have cheese puffs in your inventory: When I receive [showSprite] show When green flag clicked hide
That should do the trick... and reset the sprite that shows when the green flag gets clicked.
Also, this may be better suited for All About Scratch, so I doth move it.
Last edited by coolstuff (2010-06-04 18:55:30)
Offline
<when green flag clicked>
<if><(Cheese Puffs <>> 0 )>
<say[ Message
<end>
<if><(Cheese Puffs <=> 0 )>
<say[ Other Message
<end>
Offline
coolstuff wrote:
I'm assuming that the inventory is a list. If not, ignore what follows
Here's the script:Code:
//On the sprite that speaks... When person clicked if <[inventory] contains [cheese puffs]> say "You have cheese puffs in your inventory!" broadcast [showSprite] else says "Sorry, no cheese puffs here!" end //And on the sprite that shows if you do have cheese puffs in your inventory: When I receive [showSprite] show When green flag clicked hideThat should do the trick... and reset the sprite that shows when the green flag gets clicked.
Also, this may be better suited for All About Scratch, so I doth move it.
Oh sry... I forgot to mention that there is another sprite that shows what there saying like in a game called exscape the school if you need an example of what it is, so the sprite doesnt acualy say anything... Sry that you figured that out for nothing...
Offline
kluspossible wrote:
Oh sry... I forgot to mention that there is another sprite that shows what there saying like in a game called exscape the school if you need an example of what it is, so the sprite doesnt acualy say anything... Sry that you figured that out for nothing...
Oh, don't worry about it. If you can describe to me what you want in greater detail, I can help you out.
Offline
coolstuff wrote:
kluspossible wrote:
Oh sry... I forgot to mention that there is another sprite that shows what there saying like in a game called exscape the school if you need an example of what it is, so the sprite doesnt acualy say anything... Sry that you figured that out for nothing...
Oh, don't worry about it. If you can describe to me what you want in greater detail, I can help you out.
Ok, in greater detail:
The game is called exscape school and you are trying to exscape from school. When a person is clicked/ something happens it brodcasts a certain thing and another sprite changes costumes to show what they are saying. in a when you enter a certain classroom there is a sprite (cheese puffs) sitting in the room. When I click it it hides and another sprite comes up in my inventory. When I go into the girls bathroom there is a girl there that is complaining she's hungry( the sprite that shows what people are saying shows it) and wants you to get her something. But she onluy saus that if you dont have the cheese puffs. If you have the cheese puffs the sprite shows her saying that shes happy and she "gives" you a bentendo gs that appers in our inventory.
Offline
--> On the first Cheese Puffs sprite that you need to click: When Green Flag clicked delete [all] from [inventory] When Cheese Puffs clicked add [cheese puffs] to [inventory] broadcast [add cheese puffs] --> On Cheese Puffs sprite 2 for the inventory When Green Flag clicked show --> On the talking sprite When I recieve [I'm in the girl's bathroom] if <[inventory] contains [cheese puffs]> say "THANK YOU FOR THE CHEEZE PUFFEZ!" broadcast [showSprite] else says "I'm hungry." end
Should work great... I assumed you used broadcasts to determine that you're in the girls' bathroom, but you may need to do it differently.
Offline
coolstuff wrote:
Code:
--> On the first Cheese Puffs sprite that you need to click: When Green Flag clicked delete [all] from [inventory] When Cheese Puffs clicked add [cheese puffs] to [inventory] broadcast [add cheese puffs] --> On Cheese Puffs sprite 2 for the inventory When Green Flag clicked show --> On the talking sprite When I recieve [I'm in the girl's bathroom] if <[inventory] contains [cheese puffs]> say "THANK YOU FOR THE CHEEZE PUFFEZ!" broadcast [showSprite] else says "I'm hungry." endShould work great... I assumed you used broadcasts to determine that you're in the girls' bathroom, but you may need to do it differently.
Thanks! this is a huge help and it works great!
Last edited by kluspossible (2010-06-24 19:22:05)
Offline