Skip to main content
The Deno 2 Release Candidate is here
Learn more
method RandomUtil.prototype.rollForChanceProbability
import { RandomUtil } from "https://deno.land/x/sptaki@1.2.0/utils/RandomUtil.d.ts";

Rolls for a probability based on chance

Examples

rollForChanceProbability(0.25); // returns true 25% probability

Parameters

probabilityChance: number

Probability Chance as float (0-1)

Returns

boolean

If roll succeed or not