# Checks & Flags

A flag is a variable that can be trigger on within your story. A flag can only be turned on once and is considered true for the remainder of your story.

Checks are actions that can look at a flag and see if it has been set to true. If so it may trigger a success action, otherwise trigger a fail action.

For example, you may have a page set a flag named "HAS\_KEY". Then, on a later page trigger a check called "CHECK\_HAS\_KEY". If you visited the key page and HAS\_KEY is true, you will be directed to a success page, otherwise a fail page.

After considering the flags you need in your story, start by adding the flag from the Flags tab.

<figure><img src="https://550862792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnrOPyf3TwLa8A58CVIna%2Fuploads%2FL0gHTS68wEKcOSzVtWtC%2Frpgchain-flag-1.png?alt=media&#x26;token=409e8651-bc59-4594-9ec7-19493a2523b8" alt=""><figcaption></figcaption></figure>

Then, set this flag in your story by assigning it on a page

<figure><img src="https://550862792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnrOPyf3TwLa8A58CVIna%2Fuploads%2FVQLDYnAnZkcw99ZtsR15%2Frpgchain-flag-2.png?alt=media&#x26;token=58fae53e-0efc-4c58-85b2-26ec6a1fc7c2" alt=""><figcaption></figcaption></figure>

Then, on the Checks tab, you can create a new check to verify this flag is true, and decide where the player should go based on if this flag exists or not

<figure><img src="https://550862792-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnrOPyf3TwLa8A58CVIna%2Fuploads%2FMuunWgaKGWYtfRQrZqac%2Frpgchain-check.png?alt=media&#x26;token=dd63ae46-3c23-4daa-8a71-020fdd91ab0c" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="200.20703125">Field</th><th>Description</th></tr></thead><tbody><tr><td>Key</td><td>A unique identifier for your check so it can be found in other action select fields</td></tr><tr><td>Flag</td><td>Select the Flag this check will be verifying exists or not</td></tr><tr><td>On Success</td><td>The page, check, or roll to trigger if this check is a success</td></tr><tr><td>On Fail</td><td>The page, check, or roll to trigger if this check is a fail</td></tr></tbody></table>
