# Build a reusable skill check

A reusable skill check reads its threshold from Script metadata. You can use the same Condition to test whether the player is strong enough to move a boulder or enter a tournament, changing only the number in the Script.

## Before you begin

Create a **Script** and a **Compendium**. The Compendium must be visible to the **Dialogue** component that runs the Script. This example also assumes that the **Stats** module defines the player's **Strength** Attribute.

## Pass the threshold

Add a `compare` metadata value to the `@if` line. The value represents the minimum Strength required by this branch:

```dialogue
@if strength-check [compare:8]
  Narrator: You push the boulder aside with incredible strength.
@else
  Narrator: You try to push the boulder, but it is too heavy.
```

The Script calls the `strength-check` Condition and exposes `8` as the active line's `compare` metadata.

## Create the Condition

1. Open the Compendium and add a Condition named `strength-check`.
2. Add a **Compare Numbers** Condition.
3. Read the player's **Strength** for the first value.
4. Select the numeric **Active Line Metadata** Signal for the second value.
5. Set **Dialogue** to **Last Dialogue Started** and **Metadata** to `compare`.
6. Set **Compare** to **Greater Or Equal**.

![Compare Numbers Condition reading a threshold from active line metadata](../../assets/script-metadata-example.jpg)

The Condition reads metadata from the Dialogue's current line. If the `compare` key is missing, the numeric Signal returns `0`.

## Verify the result

Run the Script with the player's Strength below `8`, then at or above `8`. The first run follows `@else`; the second runs the success branch.

Now reuse the Condition for a tougher check by changing the metadata value:

```dialogue
@if strength-check [compare:12]
  Guard: You may enter the tournament.
@else
  Guard: Return when you are stronger.
```

With `compare` set to `12`, the same Condition now requires at least `12` Strength to enter the tournament.

## Where to go next

- **[Metadata](../../syntax.md#metadata)** — pass Boolean, numeric, and string values from a Script.
- **[Conditions](../../compendiums.md#conditions)** — define named checks in a Compendium.
- **[Scripts](../../scripts.md#your-own-metadata)** — override built-in settings and create custom metadata keys.
