Is there any particular reason for using randomInteger, out of interest? It doesn't use the Quantum roll server, it's just uses the vanilla JS Math library to generate a number. I honestly don't know enough math to have any idea if the Roll20 one is any better than just calling Math.random(), but they look reasonably similar to me. Math.random(): function random () { // Closure to return a random double: var n = arc4 . g ( chunks ); // Start with a numerator n < 2 ^ 48 var d = startdenom ; // and denominator d = 2 ^ 48. var x = 0 ; // and no 'extra last byte'. while ( n < significance ) { // Fill up all significant digits by n = ( n + x ) * width ; // shifting numerator and d *= width ; // denominator and generating a x = arc4 . g ( 1 ); // new least-significant-byte. } while ( n >= overflow ) { // To avoid rounding up, before adding n /= 2 ; // last byte, shift everything d /= 2 ; // right using integer math until x >>>= 1 ; // we have exactly the desired bits. } return ( n + x ) / d ; // Form the number within [0, 1). } ...and the function called by Roll20's randomInteger: function randomInt ( n ) { if ( n < 0 ) { throw \ "n must be non-negative \" } // Determine the number of counts needed to generate a the number, minimum is 1 var counts = Math . max ( Math . ceil ( Math . log ( n ) / Math . log ( width )), 1 ); // If counts is greater than 6 then maxRand is greater than 2^53 which is the // largest safe int in JavaScript. This library cannot generate random ints larger // than width^chunks if ( counts > chunks ) { throw \ "n cannot be greater than \" + width + \" ^ \" + chunks ; } // Calculate the maximum random number possible for the counts var maxRnd = Math . pow ( width , counts ); // Calculate the maximum valid random number to prevent uneven distribution var maxValid = n * Math . floor ( maxRnd / n ); var rnd ; var pass = 0 ; do { rnd = arc4 . g ( counts ); pass ++; } while ( rnd >= maxValid && pass < 100 ); // Ignore numbers that are outside of the valid range return rnd % n ; } You may as well just roll your own from Math.random(), rather than make your sheet dependent on an API function for the sake of one line of code. You can even throw a default range variable in for bonus points, if you're usually rolling a d20: const randomInteger = ( range = 20 ) => ( range > 0 ) ? Math . ceil ( Math . random ()* range ) : null ; Someone with some proper math knowledge might be able to suggest whether the randomInt() function is significantly better than Math.random() - if it is, you can just substitute it for the Math.random() call. If you're looking to use the Quantum roller, you'll need to activate it from chat with a [[1d20]] or with Custom Roll Parsing. You could use the API instead via sendChat(), it's just the long way around from the sheet sandbox, and again, means your sheet won't work without the API.