Var FiveM
ScriptsBundlesDocs
VAR
Var FiveM
ScriptsBundlesDocs
NewsTheme CustomizerAboutContact
Shop Now

-- 29 sections

  • ›paintball
  • ›chess
    • configuration
    • events
    • integration-example
    • exports
    • controls
    • config
  • ›supermarket simulator
  • ›coins shop
  • ›clothes shop
  • ›casino
  • ›drugs
  • ›clothes shop v2
  • ›interaction
  • ›emote
  • ›crew
  • ›alert job
  • ›pin code
  • ›society manager
  • ›property
  • ›barber shop
  • ›shop with basket
  • ›tattoo shop
  • ›gardener job
  • ›heist atm
  • ›heist fleeca
  • ›poster job
  • ›loading screen
  • ›bank
  • ›autocardealer
  • ›character creator
  • ›multi character
  • ›bill
  • ›tattoo shop v2

~/docs/chess/configuration/events

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

Chess

Events

-- 3 code blocks · 1 min read

get var-chesstry it on the test server
inote

All three are server-side, server-to-server events. Integrators react with AddEventHandler in a server script.

var_chess:server:matchStarted

Fires when a match starts (status becomes playing).

lua
-- payload: { id, white, black, bet = { white, black }, ai }
-- white / black: seat server id (number), or nil when that seat is the AI.  ai: boolean.
AddEventHandler('var_chess:server:matchStarted', function(data)
    print(('chess started at table %s, ai=%s'):format(data.id, tostring(data.ai)))
end)

var_chess:server:matchEnded

Fires when a match ends (checkmate, resign, draw or forced).

lua
-- payload: { id, winner = 'white' | 'black' | nil, reason, white, black, pot }
-- reason: 'checkmate' | 'resign' | 'stalemate' | 'fifty' | 'forced'.  pot: total staked.
AddEventHandler('var_chess:server:matchEnded', function(data)
    print(('chess ended at table %s, winner=%s pot=%s'):format(data.id, tostring(data.winner), data.pot))
end)

var_chess:server:move

Fires after each validated move is applied.

lua
-- payload: { id, color = 'white' | 'black', from, to, capture }
-- from / to: algebraic squares ('e2', 'e4').  capture: captured piece code ('bp') or nil.
AddEventHandler('var_chess:server:move', function(data)
    print(('table %s: %s %s-%s'):format(data.id, data.color, data.from, data.to))
end)
previousconfigurationnextintegration-example
VAR
Var FiveM

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

28scripts
1,500+sales

Scripts

  • Marketplace
  • Bundles
  • Theme Customizer

Most Popular

  • Supermarket Simulator
  • FiveM Casino Script
  • FiveM Coin Shop
  • FiveM Emote Menu
  • FiveM Paintball Script
  • FiveM Clothing Shop Script
  • FiveM Interaction Script
  • FiveM Character Creator

Resources

  • Free Scripts
  • Guides
  • News
  • Documentation
  • Support

Company

  • About
  • Contact
  • Discord

Legal

  • Terms
  • Privacy
  • Refunds

© 2026 Var FiveM. All sales final.

Payments byTebex