-4

I want to be able to randomly generate a number with small chance and otherways generate default number, for example, a character has 120 attack points with a 30% chance to hit critical but that critical damage deals 20% more damage which makes the damage range from 120 to 144

So if I click a button or enter a command to fight, theres 30% chance for program to generate a number from 120 to 144 but theres 70% chance that program gives only 120.

Community
  • 1
  • 1
Sonny
  • 9
  • 4
  • This certainly has never been asked or written about anywhere on the internet... [ask] – Julien Aug 25 '23 at 01:52
  • Does this answer your question? [Generate random integers between 0 and 9](https://stackoverflow.com/questions/3996904/generate-random-integers-between-0-and-9) – Ken Y-N Aug 25 '23 at 01:54
  • no I need to take into account the percentages – Sonny Aug 25 '23 at 02:33

0 Answers0