# Modify the controller with a Stat

Check this 3 Samples on how to Modify different behaviours of the AC with different [Stats](https://malbersanimations.gitbook.io/animal-controller/global-components/stats)

{% tabs %}
{% tab title="✔Stamina Stat" %}
Let's *disable* the **Sprint** on the **animal** when the **Stamina** gets below 10. and *enable* it back when the Stamina is over 15.

* Select the Stamina Stat on the Stats Component and search for the Event Section:

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M-zqq-cHgv-jUTw-ki5%2F-M-zr7_Bsx3zEz4QuAuk%2Fimage.png?alt=media\&token=d6fe7fc0-3e62-46f1-9b63-d52e21650643)

* On the **Below** and **Above** Section, Set Below=**10** and Above = **15**.
* On the **Event On Stamina Below 10,** Add a new Listener and Use MAnimal > UseSprint = False
* On the **Event On Stamina Above 15,** Add a new Listener and Use MAnimal > UseSprint = True

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M-zqq-cHgv-jUTw-ki5%2F-M-zrHXpwMxi2quCCgst%2Fimage.png?alt=media\&token=51271e62-2316-4f5f-b46a-35b879f59838)

That way when the Stamina will disable the Use Sprint Parameter on the Animal in case it gets below 10 and it will enable it back when is above 15.

#### Now we need to Start **degenerating** the **Stamina** when the Sprint is true on the Animal.

We can do this by using the **On Sprint Enable**  Event on the Animal.

* Create 2 Listeners on the Event.
* On the 1st Listener use Stat > Stat\_Pin(StatID)
* On the 2nd Listener use Stat > Stat\_Pin\_Degenerate(bool) \**Dynamic Bool*

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-M-zsua7RcJHib_yjNR4%2F-M-ztILKr5hF--ydAlMZ%2Fimage.png?alt=media\&token=af877a38-a05d-4759-9a4b-d9ac3eb4607e)

That way every time we use the sprint .. the Stamina Stat will degenerate.. and when we release the sprint the Stamina Stat will stop degenerating.
{% endtab %}

{% tab title="Health Stat" %}
\<Finish it Here>

{% endtab %}

{% tab title="Mana Stat" %}
Make the sample with the dragons
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://malbersanimations.gitbook.io/animal-controller/how-to-ac/modify-with-stat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
