I have a loot box that I want to fill with a random item. But I want each item to have a different chance of being picked. For example:
- 5% chance of 10 gold
- 20% chance of sword
- 45% chance of shield
- 20% chance of armor
- 10% chance of potion
How can I make it so that I select exactly one of the items above, where those percentages are the respective chances of getting the loot?
No comments:
Post a Comment