Skip to main content

Documentation Index

Fetch the complete documentation index at: https://fxscripts.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Run from the client. Useful for reacting to chat UI state — pausing a minigame while chat is open, hiding chat during cutscenes, etc.

isOpen()

Check whether the chat is currently open.
Client
local open = exports.fxChat:isOpen()
returns
boolean
true if the chat input is visible and focused.
Example — pause while typing
CreateThread(function()
    while true do
        if exports.fxChat:isOpen() then
            -- skip your minigame frame logic
        end
        Wait(0)
    end
end)

setVisible(visible)

Force-show or hide the chat without opening it for input.
Client
exports.fxChat:setVisible(visible)
visible
boolean
required
true to show the chat overlay, false to hide it.
Useful for cinematic moments — hide chat during cutscenes, restore on exit.
Example — hide during cutscene
exports.fxChat:setVisible(false)
DoScreenFadeOut(500)
-- ... cutscene logic ...
DoScreenFadeIn(500)
exports.fxChat:setVisible(true)

focus(open)

Open or close the chat input programmatically.
Client
exports.fxChat:focus(open)
open
boolean
required
true to open and focus the input, false to close.
Example — bind a custom key
RegisterCommand('+chatopen', function()
    exports.fxChat:focus(true)
end, false)

RegisterKeyMapping('+chatopen', 'Open chat', 'keyboard', 'Y')

addLocalMessage(options)

Render a message only for the current player, without bouncing through the server. Great for client-side feedback.
Client
exports.fxChat:addLocalMessage(options)
options accepts the same fields as the server-side addMessage (minus target).
Example — pickup feedback
RegisterNetEvent('myresource:itemPicked', function(itemName)
    exports.fxChat:addLocalMessage({
        args = ('You picked up a %s.'):format(itemName),
        title = 'Inventory',
        color = '#10b981',
    })
end)
addLocalMessage is not broadcast. Only this client sees it. If you need other players to see the message too, use the server-side addMessage.

getActiveTheme()

Returns the name of the theme currently applied to this client.
Client
local themeName = exports.fxChat:getActiveTheme()
returns
string
e.g. "default", "midnight", "ghostty". Matches a JSON file in themes/.

setActiveTheme(name)

Switch the chat theme for this client.
Client
exports.fxChat:setActiveTheme(name)
name
string
required
The theme filename without .json (e.g. "midnight").
Example — themed by job
local PlayerData = ESX.GetPlayerData()
if PlayerData.job.name == 'police' then
    exports.fxChat:setActiveTheme('crimson')
end