# Usage

* **Using a Command**
  * If <mark style="color:red;">`Config.UseCommand = true`</mark>, players can type <mark style="color:red;">`/<command>`</mark> (e.g., <mark style="color:red;">`/firework`</mark>) to launch a random or specified firework.
  * Depending on your script logic, it may spawn the firework prop near them, play a launch animation, and display effects.
* **Using an Item**
  * If <mark style="color:red;">`Config.UseItem = true`</mark>, players can **use** the <mark style="color:red;">`Config.ItemName`</mark> item from their inventory (ESX/QBCore).
  * When used, it triggers the same launching sequence or a different one (depending on your code) to create the firework effect.
* **Custom Firework Types**
  * By default, <mark style="color:red;">`fireworkl`</mark>, <mark style="color:red;">`fireworkm`</mark>, and <mark style="color:red;">`fireworkr`</mark> are defined. You can add more types in the `Config.Fireworks` table, each with unique visuals or timing.
* **Distance-Based Sound**
  * <mark style="color:red;">`Config.soundRadius`</mark> controls how far the launching or explosion sounds can be heard.
  * Ensure this radius isn’t too large for performance reasons or too small to diminish immersion.
* **Optimized Performance**
  * The script is designed to handle multiple fireworks simultaneously without lag.
  * If your server hosts huge fireworks shows, just watch the resource usage in “resmon” to confirm smooth performance.


---

# 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://risk-scripts.gitbook.io/risk-scripts/scripts/firework-script/usage.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.
