> For the complete documentation index, see [llms.txt](https://risk-scripts.gitbook.io/risk-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://risk-scripts.gitbook.io/risk-scripts/scripts/firework-script/usage.md).

# 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.
