I have this script:
When green flag clicked
Delete all of List 2
Repeat (pick random (1) to (5)
Set Choosing to item any of List 1
If not Choosing = item any of List 2
Add Choosing to List 2
Else
Delete item Choosing of List 2
Add Choosing to List 2
Say List 2
It works okay, but part of the game is that it does not say any item twice.
How do make it so it fits the rules of the game?
Offline
coolstuff wrote:
Hm... What are the rules of the game? Then I might be able to help you
![]()
Well, it's a pizza making game, where you make pizzas, and the customers order random pizzas. It would be easier for them to say "Can I have a Pepperoni Olive Pizza?"
than "Can I have a Pepperoni Olive Pineapple Pepperoni Olive pizza?" right?
Offline
Here's your script:
It's too wide for posts, so it'll be shrunken down... click here to see it in full size.
How the script works:
• Topping 1 is set to a random topping in the list of toppings. The join block with the setting of the Topping variables is so there can be a space at the end - this is for the part when the sprite says the sentence.
• Topping 2 is set to a random topping. If Topping 2 is the same topping as Topping 1, Topping 2 will set to a random topping until it is a different topping from Topping 1.
• Topping 3 is set to a random topping. If Topping 3 is the same topping as Topping 1 or Topping 2, Topping 3 will set to a random topping until it is different from Topping 1 and Topping 2.
• All three toppings are ready (and different) - now the sprite says the wanted pizza. If spaces weren't put into the Topping variables earlier, we would have to put them in here - and the script would be even wider!
Hope I helped! Any questions?
Offline
Or if you wanted an infinite number of toppings, you could do this:
Add all your toppings to the "Toppings" list, and replace the min and max Toppings variables with your own values in the script. Also, the script automatically calibrates how long it says the "I want a _ pizza" based on the number of toppings - 1 topping yields 2 seconds, 2 toppings 3, and 3 4, etc.
Last edited by The-Whiz (2010-06-21 07:16:26)
Offline
You both have great scripts, and both work, but I want infinite toppings Thank you both
Last edited by samurai768 (2010-06-21 23:48:53)
Offline