Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Is there a way to keep data stored even after the script restarts?

So what I mean by this is if I do a command that adds a value to an array is there anyways for that data to stay there even after the script restarts?
1492234040

Edited 1492234122
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, you want the  state object . Be very careful with the state object as it is shared across all scripts in the campaign. It has a memory capacity of 2mb (for everything stored by every script). Don't assign values directly to the state (e.g. state=5). The way to use the state is to make a namespace for your script (e.g. state.PAGENAVIGATOR = {}). Then we assign things to that object of the state (e.g. state.PAGENAVIGATOR.version = 2.0).