Var FiveM
ScriptsBundlesSubscriptionsDocs
VAR
Var FiveM
ScriptsBundlesSubscriptionsDocs
Theme CustomizerAboutContact
Shop Now

-- 28 sections

  • ›paintball
    • configuration
    • features
    • anti-cheat-integration
    • game-modes
    • api
    • arenas
    • command
    • config
  • ›chess
    • configuration
    • events
    • integration-example
    • exports
    • controls
    • config
  • ›supermarket simulator
    • configuration
    • catalog-manager
    • commands-and-permissions
    • props-editors
    • owning-and-running-a-store
    • config
  • ›coins shop
    • configuration
    • identifier
    • export
    • server-event
    • languages
    • products
    • delivery
    • owner-panel
    • webhooks-discord
  • ›clothes shop
    • installation
    • configuration
    • blips-marker
    • translate
    • change-cam-and-pos
  • ›casino
    • installation
    • configuration
    • main-config
    • horse
    • lucky-whell
    • translate
  • ›drugs
    • installation
    • configuration
    • labs-and-interiors
    • maintenance-and-modules
    • missions
    • street-selling
    • administration
  • ›clothes shop v2
    • installation
    • configuration
    • position
    • advice-and-troubleshooting
    • configure-clothing-shops
  • ›interaction
    • configuration
    • public-api
    • interaction-config-reference
    • dialog-system
  • ›emote
    • configuration
    • config
    • adding-emote
    • menu
    • keybind
    • modules
    • 3d-placement
    • playlist
    • wheel
    • shared-emotes
  • ›crew
    • installation
    • export
  • ›alert job
    • installation
    • server-export
  • ›pin code
    • installation
    • export
  • ›society manager
    • installation
    • export
    • configuration
    • translate
    • max-salary
    • last-invoice
  • ›property
    • installation
    • configuration
    • translate
    • add-interior
  • ›barber shop
    • installation
    • configuration
    • change-menu-open-source
    • blips
    • translate
    • add-shop
  • ›shop with basket
    • installation
    • configuration
    • item-category-config
    • blips-marker
    • translate
    • add-shop
  • ›tattoo shop
    • installation
    • configuration
    • edit-tattoo
    • blips-marker
    • translate
    • add-shop
  • ›gardener job
    • installation
    • configuration
    • change-pos-farm
    • blips
    • translate
  • ›heist atm
    • installation
    • configuration
    • event-money
    • translate
    • police-alert
  • ›heist fleeca
    • installation
    • configuration
    • translate
    • pos-fleeca-heist
  • ›poster job
    • installation
    • configuration
    • change-pos-farm
    • change-poster-texture
    • blips-marker
    • translate
  • ›loading screen
    • installation
    • configuration
  • ›bank
    • installation
    • configuration
    • position
    • blips
    • translate
    • society
  • ›autocardealer
    • installation
    • configuration
    • add-vehicles
    • translate
    • blips
    • coords
  • ›character creator
    • installation
    • configuration
    • translate
    • expression
    • spawn
  • ›multi character
    • installation
    • configuration
    • translate
    • change-character-creator
    • commands
  • ›bill
    • installation
    • configuration
    • translate
    • control

~/docs/chess/configuration/exports

chess docs›
  • configuration
  • configuration/events
  • configuration/integration-example
  • configuration/exports
  • configuration/controls
  • configuration/config

Chess

Exports

-- 11 code blocks · 1 min read

get var-chesstry it on the test server
inote

The server exports are callable server-side only, the client exports client-side only.

Server

GetMatch

exports['var_chess']:GetMatch(tableId)

Returns a safe snapshot of the match at tableId, or nil if the id is invalid.

lua
-- { id, status, seats = { white, black }, turn, bet = { white, black }, winner, reason }
-- seats: a server id (number) | 'AI' | false.  turn: 'w' | 'b' | nil.  status: idle | waiting | playing | over.
local match = exports['var_chess']:GetMatch(1)

GetPlayerMatch

exports['var_chess']:GetPlayerMatch(serverId)

Returns the table a player is seated at, or nil.

lua
-- { tableId, color = 'white' | 'black', status }
local seat = exports['var_chess']:GetPlayerMatch(source)

IsPlayerInGame

exports['var_chess']:IsPlayerInGame(serverId)

Returns true only if the player is seated in a match that is currently playing.

lua
if exports['var_chess']:IsPlayerInGame(source) then
    -- block teleport / job actions while a wagered game is live
end

GetActiveMatches

exports['var_chess']:GetActiveMatches()

Returns a list of matches in progress.

lua
-- { { tableId = 1, status = 'playing' }, ... }
local active = exports['var_chess']:GetActiveMatches()

StartAIGame

exports['var_chess']:StartAIGame(serverId, tableId, side, level, bet)

Seats the player against the AI and starts the game. side is 'white', 'black' or nil (defaults to white), level is a Config.AI.levels id, bet is sanitized server-side. Returns true on success, false if the table is busy, the AI is disabled or the player cannot afford the wager.

lua
local ok = exports['var_chess']:StartAIGame(source, 1, 'white', 'hard', 500)

ForceEndMatch

exports['var_chess']:ForceEndMatch(tableId, winnerColor)

Ends an in-progress match. winnerColor is 'white', 'black' or nil for a draw. Settlement (payout / refund) runs as usual. Returns true if a playing match was ended.

lua
exports['var_chess']:ForceEndMatch(1, 'white')

Client

IsSeated

exports['var_chess']:IsSeated() returns true if the local player is seated at a board.

lua
local seated = exports['var_chess']:IsSeated()

IsInGame

exports['var_chess']:IsInGame() returns true if the local player is seated in a match that is playing.

lua
if exports['var_chess']:IsInGame() then return end

GetCurrentTable

exports['var_chess']:GetCurrentTable() returns the local player's current table id, or nil.

lua
local tableId = exports['var_chess']:GetCurrentTable()

GetColor

exports['var_chess']:GetColor() returns 'white', 'black' or nil.

lua
local color = exports['var_chess']:GetColor()

OpenLobby

exports['var_chess']:OpenLobby(tableId) opens the chess menu for a nearby (spawned) table. Returns false if the table is not in range.

lua
exports['var_chess']:OpenLobby(1)
previousintegration-examplenextcontrols
VAR
Var FiveM

Premium FiveM scripts. Low resmon, high quality. Built for ESX, QBCore & Standalone.

28scripts
1,500+sales

Scripts

  • Marketplace
  • Bundles
  • Subscriptions
  • Theme Customizer

Most Popular

  • Supermarket Simulator
  • FiveM Casino Script
  • FiveM Coin Shop
  • FiveM Emote Menu
  • FiveM Paintball Script

Resources

  • Guides
  • Documentation
  • Support

Company

  • About
  • Contact
  • Discord

Legal

  • Terms
  • Privacy
  • Refunds

© 2026 Var FiveM. All sales final.

Payments byTebex