Lists & Helpers
weightedChoice
$weightedChoice — Picks one item at random, the heavier the weight the likelier it is (drops, lotteries)
Picks one item at random, the heavier the weight the likelier it is (drops, lotteries).
Syntax
$weightedChoice[items;weights;(separator)]
Parameters
- items (text, required) — The items.
- weights (text, required) — One non negative number per item, same separator.
- separator (text, optional) — The text between two items. Default:
,.\nmeans a new line.
Return Value
- string: the item, or empty when there is nothing to pick.
Usage
$weightedChoice[common,rare,epic;70,25,5]
Important Notes
- Items and weights must have the same count.
Example
$sendMessage[$weightedChoice[common,rare,epic;70,25,5]]
Try it
Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.