chance %pct:NUMBER% — Expressions

chance %pct:NUMBER%
Math1.0.0

Description

Returns true with the given percentage chance (0 to 100). For example, 'chance 25' succeeds roughly 25% of the time.

Examples

set lucky to chance 10
if chance 50: message player "Heads!"

All Possible Usages (1)

Every distinct way you can write this pattern, with optional groups and choice groups expanded. Placeholders are shown as <name>.

chance <pct>

Related (Math)