> For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.0resmon.org/0resmon/0resmon-1/s4-resources/s4-crosslab/exports.md).

# Exports

CrossLab exposes a few exports so you can interact with it from other resources — useful if you want to open the menu through a different UI, sync crosshair settings with something else, or build on top of the system.

{% tabs %}
{% tab title="Client-side" %}
These are called from client scripts in another resource.

```lua
-- Open / close the crosshair menu
exports['s4-crosslab']:openMenu()
exports['s4-crosslab']:closeMenu()

-- Check if the menu is currently open
local open = exports['s4-crosslab']:isMenuOpen()  -- returns boolean

-- Get the current crosshair settings table
local settings = exports['s4-crosslab']:getCrosshairSettings()
```

The settings table returned by `getCrosshairSettings` is the same structure as `Config.DefaultCrosshair`:

```lua
{
    crosshairEnabled  = true,
    crosshairStyle    = 4,
    size              = 3,
    thickness         = 1,
    gap               = -3,
    fixedGap          = -25,
    csColor           = 1,
    colorR            = 46,
    colorG            = 250,
    colorB            = 46,
    alpha             = 200,
    useAlpha          = true,
    dotEnabled        = false,
    tStyleEnabled     = false,
    outlineEnabled    = false,
    outlineThickness  = 1,
}
```

{% endtab %}

{% tab title="Server-side" %}
These are called from server scripts in another resource.

```lua
-- Get the saved crosshair settings for a player (returns nil if not loaded yet)
local settings = exports['s4-crosslab']:getCrosshairSettings(source)

-- Overwrite a player's crosshair and sync it to their client immediately
local ok = exports['s4-crosslab']:setCrosshairSettings(source, {
    crosshairEnabled = true,
    crosshairStyle   = 2,
    size             = 4,
    -- etc.
})
```

`setCrosshairSettings` saves the data to the player's file and triggers a client sync right away. It returns `true` on success, `false` if you passed a nil data table.
{% endtab %}
{% endtabs %}

## Notes

* Settings are cached in memory on the server as soon as a player loads. `getCrosshairSettings` reads from that cache, not the file, so it's fast.
* If you call `setCrosshairSettings` before the player has fully loaded, the data will still be saved to file and applied next time they trigger `s4-crosslab:playerLoaded`.


---

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

```
GET https://docs.0resmon.org/0resmon/0resmon-1/s4-resources/s4-crosslab/exports.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.
