@gandalfwisdom/weightbuddy
v1.0.0
Published
A basic weighted chance roller for Roblox.
Readme
WeightBuddy
A basic weighted chance roller for Roblox.
Features
Allows for the simple rolling of weighted chance tables.
Usage
Simply construct a dictionary of objects with a number value representing their weight like so:
local rarities = {
["Common"] = 60;
["Uncommon"] = 30;
["Rare"] = 10;
["Legendary"] = 0.5;
};Next simply roll that table and retrieve the item name returned from the roll!
local WeightBuddy = require(path.to.weightbuddy);
local roll = WeightBuddy.roll(rarities);
print(roll);
-- Output: "Common" (Or whatever you happened to roll from the table)Installation
WeightBuddy supports Nevermore's npm package installation method.
Simply type npm install @gandalfwisdom/weightbuddy in your CLI on your project to install.
