Exports
Add and remove STG Chess V2 tables from your own scripts, for example permanent tables in a park, a bar or an event area.
Other resources can add and remove chess tables while the server runs. Tables added this way work like the fixed tables in the config: players can not remove them, and the table stays when a player leaves.
Tables added by exports are not saved. Add them again after every restart, for example when your resource starts. For tables that never change, the Config.FixedTables list is simpler.
Server exports
createTable
local tableId = exports['stg-chessv2']:createTable(vector4(239.32, -875.98, 29.55, 207.68), nil, 10, 0)| Argument | Type | Description |
|---|---|---|
coords | vector4 | Position and heading of the table. z is the floor height. |
heading | number or nil | Heading of the table. Leave it nil to use the heading in coords. |
minutes | number | Minutes per side on the clock, 1 to 180. Default 10. |
increment | number | Seconds added after every move, 0 to 60. Default 0. |
Returns the id of the new table. Keep it if you want to remove the table later.
removeTable
local removed = exports['stg-chessv2']:removeTable(tableId)Removes the table for everyone. Players sitting at it are stood up and their game is cancelled. Returns true when the table was removed and false when no table has that id.
Still having trouble?
Open a ticket on our Discord. Our team answers around 15 hours a day.