Skip to content

Roll tables is now asynchronous #2

@RamonRBF

Description

@RamonRBF

Now it is needed to put the await command in front of the rolls and correct the path which the text is inside the data object now.

/*
 * Examples for using roll tables
 * Examples assume existence of a basic roll table
 * called "Months" that contains text entries
 */

// Roll table and output to chat
game.tables.getName('Months').draw();

// Roll table and store result for later use
let roll = await game.tables.getName('Months').roll();

// Roll table and send custom chat with result
let draw = await game.tables.getName('Months').roll();
let month = draw.results[0].data.text;
ChatMessage.create({ content: `The month is: ${month}`});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions