• Performs an actor based d20 roll.

    Parameters

    Returns Promise<undefined | object | ChatMessage>

    The created ChatMessage document, the object of data that would be used to create one, or undefined if cancelled

    Example

    Rolling a 1d20 + an actor's BAB + 2 for good behavior

    const actor = game.actors.getName("Righteous Paladin");
    await pf1.dice.d20Roll({
    skipDialog: true, // Roll away without a dialog
    flavor: "BAB", // Add a flavor/title to the roll
    parts: [`${actor.system.attributes.bab.total}[BAB]`], // Use the actor's BAB
    dice: "2d20kh", // Roll 2 d20s and keep the highest
    bonus: "2[Good Behavior]", // Add a static bonus of 2
    rollMode: "gmroll", // Make roll only visible to user and GM
    });

Generated using TypeDoc