# Resource Handlers

Resource handlers provide a way to customize the adding or removal of resources from a resource container in the inspector.

To create it in your own script, simply add a *Resource Handler* variable and it will appear in the inspector with all the settings you can change.

### Checking Resource Handlers

You may want to check if a resource is available before running some code, for example to check if ammo is available before firing. You can do this by calling the *Ready* function on the resource handler, which returns True if the specified resources are available, and False if not.

### Implementing Resource Changes

Once you've checked if a resource is available, you can implement the resource change by simply calling the *Implement* function on the resource handler, which will carry out the transaction with the resource container.&#x20;

So if you want to draw ammo after firing, for example, run the firing code and then call *Implement* on the ammo resource handler, or vice versa.


---

# 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://vsxgames.gitbook.io/universal-vehicle-combat/resources-system/resource-handlers.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.
