I am trying to write a method rollDice(int number, int nSides) which returns the total result of rolling the number dice with nSides sides.
So for example rollDice(3
replace int roll = r.nextInt(); with
int roll = r.nextInt();
int roll = r.nextInt(nSides);