Function: chance()
ts
function chance(rate: number, base?: number): boolean;Get math random based chance to happen by base of provided parameter. By default, calculates 'rate' of 100.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
rate | number | undefined | Chance to happen (0 - base). |
base | number | 100 | Chance base. |
Returns
boolean
Whether thing should happen.