> For the complete documentation index, see [llms.txt](https://malbersanimations.gitbook.io/animal-controller/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malbersanimations.gitbook.io/animal-controller/how-to-ac/modify-with-stat.md).

# Modify the controller with a Stat

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

{% 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:

![](/files/-M-zr7_Bsx3zEz4QuAuk)

* 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

![](/files/-M-zrHXpwMxi2quCCgst)

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*

![](/files/-M-ztILKr5hF--ydAlMZ)

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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
