> For the complete documentation index, see [llms.txt](https://docs.av-scripts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.av-scripts.com/laptop-pack-v3/cameras/replay-system.md).

# Replay System

The Replay System allows you to review world events recorded autonomously, without requiring a player to actively monitor the camera. Recordings are triggered automatically when specific actions occur.

* **Default Trigger (Gunfire):** By default, the system only detects shooting. If a player fires a weapon within the Field of View (FOV) of a replay-enabled camera, it will automatically record and save up to 30 seconds of footage to its memory.
* **Custom Triggers:** You can use the `triggerReplay()` export to manually activate the recording system on the nearest compatible camera. This will capture the movements and actions of all players and NPCs currently within its visual range.

{% hint style="success" %}
You can trigger the export when a player completes a drug sale, allowing you to record the exact moment the transaction occurs and keep a visual record of it. Similarly, you can trigger a recording when a player uses a lockpick in your vehicle theft script, among many other possibilities.
{% endhint %}

{% code title="" %}

```lua
local triggered = exports['av_cameras']:triggerReplay()
print(triggered)
-- It will return true if the script finds a nearby camera with the replay option enabled 
-- and the player within its range.
```

{% endcode %}

he replay system captures a detailed environment, tracking and recording the actions of all players, NPCs, and vehicles within its Field of View (FOV). Because of this rich data transfer from the server to the client, loading a replay for the first time may take approximately 10-15 seconds.

Once downloaded, the replay data is temporarily stored in the client's local cache. Subsequent viewings will load instantly without needing to re-download the data, provided the player does not disconnect or reconnect to the server (which clears the cache).

{% hint style="info" %}
To access a camera's recorded videos and replays, simply select the **Access Memory** option.
{% endhint %}

**Data Retention Policy:** Please note that all videos and replays are automatically deleted from the server **7 days after they are recorded**. This is done to conserve server storage space, which is especially important for the replay system, as every individual replay is saved as a `.json` file within the `json` directory.

<figure><img src="/files/OJw0TYnrdu7mEMciAF5j" alt=""><figcaption></figcaption></figure>


---

# 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://docs.av-scripts.com/laptop-pack-v3/cameras/replay-system.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.
