Random Gun Jam with Array

I’m making a revolutionary war project, and the muskets back then jammed. So I can get the gun to jam with this bit of code:

if(bulletShotCount == 30 || spitfireShotCount == 7){
canShoot = false;
}

bulletShotCount is a variable that increases by one every single time the shot is fired. So when the shot count equals 30, the gun “jams”, and the player can no longer shoot. But I want it to jam randomly, as if to say, it can jam at 10, or at 7, or at 1, or at 2. So what I though I would do is make to variables:

var bulletGunJam = int[];
var spitfireGunJam = int[];

So I figured that if I made those two variables arrays, that it would choose one of the values in the array, and pick one randomly each time. It obviously didn’t do that. Here’s the code I used:

if(bulletShotCount == bulletGunJam || spitfireShotCount == spitfireGunJam){
	canShoot = false;
	}

Is there another way to make it jam randomly?

why not just, everytime you take a shot, pick a number between 1 and 10. if the number is higher than 5 jam the gun, if not, allow the gun to fire.

example:

var shotJamChance : int;

function JamCheck()
{
    shotJamChance = Random.range(1,10)
    if(shotJamChance >=5)
    {
        Shoot();
    }
    else
    {
        JamGun();
    }

}

This would give you a 50% chance to jam, so just weight it whichever way you want, for more randomness, increase the number (so 1-50 would be more random than 1-10)