Adding percent chance

Hi!
I’m making an Android clicker game, and I want to make 5% chance that game will show different sprite (example: imagine that someone, maybe me, maybe you, made “Box Clicker”, and there is 5% chance that instead of box on screen is table).
The problem is, that I have no idea how to do it :confused:

You could create an integer variable that has the value of a random number between 1 and 20, then using and if statement to see if the number is equal to a number you’ve chose, this can be done in C# like this;

    int RandomNumber = Random.Range(0,20)
    //5% chance of the RandomNumber being 1
     if(RandomNumber == 1){
             //Do things
        }