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

# Developers

Build your own features on top of the boxing script, without touching the protected core.

The core is protected by escrow, but it was built to be extended. You get **three tools**:

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>🪝 Hooks</strong></td><td>Functions in <code>open/sv_hooks.lua</code> and <code>open/cl_hooks.lua</code>, called at every moment of a fight. They can refuse actions too.</td><td><a href="/visionstore-docs/scripts/boxing-creator/developers/server-hooks.md">Server hooks</a></td></tr><tr><td><strong>📡 Events</strong></td><td>Every hook is also an event other resources can listen to with <code>AddEventHandler</code>.</td><td><a href="/visionstore-docs/scripts/boxing-creator/developers/events-and-exports.md">Events and exports</a></td></tr><tr><td><strong>📦 Exports</strong></td><td>Read rings, matches and records, stop fights, and check who is fighting, from any resource.</td><td><a href="/visionstore-docs/scripts/boxing-creator/developers/events-and-exports.md">Events and exports</a></td></tr></tbody></table>

## Which one should I use?

| You want to...                                                          | Use                                                                                                          |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Change how *this* script behaves (block a join, reward winners)         | **Hooks**, in `open/`                                                                                        |
| React from *another* resource (Discord logs, achievements, a phone app) | **Events**                                                                                                   |
| Ask the script something (is this player fighting? what's the score?)   | **Exports**                                                                                                  |
| Run on another framework / economy                                      | **Bridges**, see [Custom framework](/visionstore-docs/scripts/boxing-creator/developers/custom-framework.md) |

## Rules of the road

* **Hooks never break a fight.** If your hook errors, the error is printed in the console and the fight goes on.
* **Data you receive is a copy.** Changing a `match` table you got from a hook or an export doesn't change the fight. Use the documented exports and hooks to act.
* **Server decides.** Money, results and permissions are server-side. Use the server hooks for anything that matters, and the client hooks for visuals.
* **Listen with `AddEventHandler`, never `RegisterNetEvent`**, so clients can't fake the events.

## The `match` table

Most hooks and exports give you this:

```lua
match = {
    ringId = 'downtown_gym',
    label = 'Downtown Gym',
    state = 'live',        -- lobby | betting | intro | countdown | live | break | verdict | result
    round = 2, rounds = 3, roundTime = 90,
    gloves = true,         -- true = gloves on, false = bare knuckle
    purse = 5000,          -- each fighter's stake
    bets = true,
    pool = { red = 12000, blue = 8000 },  -- total bets per corner
    event = false,         -- run by an admin?
    red = fighter,
    blue = fighter,        -- nil while a corner is empty
}

fighter = {
    source = 12,                -- server id
    identifier = 'ABC12345',    -- citizenid / ESX identifier / license
    name = 'John Doe',
    hp = 143.5, maxHp = 200,
    knockdowns = 1, landed = 24, heavy = 6, damage = 112,
    ready = true,
    record = { wins, losses, draws, kos, rating, tier, streak, best },
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://visionstore.gitbook.io/visionstore-docs/scripts/boxing-creator/developers.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
