For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

These are called from client scripts in another resource.

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

{
    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,
}

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.