1 more rare than two problem!

I’m trying to make it so that when you activate something it will give you 1 or 2 but 2 needs to be more rare but maybe I will have a lot so I need to do this

random number
if 9 > 11 then

elsif then

end

You know what I mean is there a better way to do this

looks like youre trying to script a rarity system -

I would generate a random number and the conditionals would be:
if num > 0.75 → 1
else → 2

yeah but thats the exact thing I dont want to make

What is the problem with this solution?