How do i make a random pick system?

0 favourites
  • 3 posts
From the Asset Store
Pick Up Items Sounds
$3 USD
50% off
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • hey ya'll i want to create a system that pick a random number and do something, example:

    1 to 5

    1- orange

    2- blue

    3- pink

    4- grey

    5- green

    when the system pick a number he reads the text attached in the number and print into screen.

    this is a simple example that will help me a lot, since now thanks

  • If it's a small range I tend to set a variable to choose(1,2,3,4,5) which picks one of the options. Or you can use random(x,y) to pick in a range.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Choose is a great option. If you use random, remember to round off the number - although that can make the first and last numbers in the range more or less likely to get picked depending on how you round.

    If you want to repeatedly pick numbers without picking the same number twice then put the numbers in an array, pick a random array element, and then remove that element from the array.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)