Russian Roulette, varying chances
APL (Dyalog Unicode), 3 bytes



Full program. Exits with code 11 or 0. Requires ⎕IO←0.

÷?⎕


Try it online!

⎕ prompt for n

? generate random integer in range 0…n-1

÷ reciprocal (errors if argument is 0)