how to do chance on gdevelop?

how can I put a chance to spawn an object? example: 50% that it rains or 50% that it is clear.
in this case I have to make it 50% cloudy or clear

use the Random command. Check it out here

Easiest to understand way is to take your percentage and check it’s less than the result from Random(100).

So, if you want a 50% chance of rain, check that Random(100) < 50.

Additionally if you have a number of chances then you add them.

So, say there a 50% chance of it being clear, 35% chance of cloud and 15% chance of rain:

1 Like