For the complete documentation index, see llms.txt. This page is also available as Markdown.

Google Docs

How to roll dice in Google Docs

Usage demo

Setup

Open the document where you want to roll, go to Tools → Scripts Editor, replace the code at the bottom with the script below, then select init.

Usage

There are two ways to run it:

  1. Click Run to start the script directly.

  2. Click the clock icon (Triggers) on the left, then Add Trigger at the bottom right, choose init, and click Save. After that, rolls run automatically whenever you reopen the Doc.

Code

Last updated