Decreasing probability

Hi, I am new to Gdevelop. For my mini game I need to make program pick a random number. So when start is clicked the value of the variable changes to RandomFloatInRange(1, 1000). I want to make the thing where numbers from 1 to 1,7 are getting picked in 50% of the situations, from 1,7 to 2,5 in 30% and so on. How can i do it

If your probabilities are not following any distribution (like a normal distribution or a flat distribution) then you have to create and nest the distribution by yourself.
For example, if you want the numbers to be:
From 1 to 7 (50% chance)
From 2 to 5 (30% chance)
From 3 to 4 (20% chance)

Then:

  • First you have to create a RandomFloat “X”. It will give you a number between 0,00… and 1,000…
  • Then you can set conditions. If “X” is below 0,5 then create a Random (1 to 7). If “X” is above 0,5 and below 0,8, then create a Random (2 to 5). Finally if “X” is above 0,8, create a Random (3 to 4).

I hope this solves it. If not, can you provide a more detailed idea of what do you want to do?

Sorry, this does not allow to edit previous answers, but I forgot to say something. The previous build will give you numbers like 3 or 4 more than 20% of the times. The reason: even if the chance is 50% and the random is from 1 to 7, it still can be a 3 or a 4.
In conclusion, even if you implement my previous solution it may not work as you intend it to work, as the numbers 1 to 7 may appear in game for the player in different rates of what you are especifing.