RE:CORD
REC_Books

Exports

Welcome to REC_Books documentation.
Added
Updated

Client side

useBlankBook

Turns the used blank book into a new book and opens the editor. ox_inventory calls it through client.export in the item definition. You do not call it yourself.

ArgumentTypeDescription
datatablePassed by ox_inventory
slot{ name: string, slot: integer, metadata: table }The used slot
exports.REC_Books:useBlankBook(data, slot)

useBook

Opens the book in metadata.bookUid of the used slot: for editing when its author can still edit it, for reading otherwise. ox_inventory calls it through client.export in the item definition. You do not call it yourself.

ArgumentTypeDescription
datatablePassed by ox_inventory
slot{ name: string, slot: integer, metadata: table }The used slot
exports.REC_Books:useBook(data, slot)

isBookOpen

Tells you whether a book is on screen.

Takes no arguments. Returns boolean.

exports.REC_Books:isBookOpen()

closeBook

Closes the book on screen without saving.

Takes no arguments.

exports.REC_Books:closeBook()

Server side

A book is identified by its uid, which the rec_book item carries as metadata.bookUid. These exports read and write the database, so call them from a thread. setHidden, purgeImages and deleteBook run as the console, so the moderation webhook names the console as the staff member.

getBookMeta

Gives you the manifest of a book.

ArgumentTypeDescription
uidstringBook uid

Returns BookManifest?, nil when the book does not exist or the tables are missing:

FieldTypeDescription
uidstringBook uid
titlestringTitle, empty until one is set
status"draft" | "sealed"sealed once bound
hiddenbooleanHidden by staff
authorNamestringCharacter name of the author
pageOrderstring[]Page ids in order
orderRevintegerRevision of the page order
bytesintegerStored size of the whole book
surfaceRevstable<string, integer>Revision of each saved surface
sealedAtinteger?When the book was bound
exports.REC_Books:getBookMeta(uid)

setHidden

Hides or shows a book. Hiding closes it on the screen of everyone reading it.

ArgumentTypeDescription
uidstringBook uid
hiddenbooleantrue hides, false shows

Returns boolean.

exports.REC_Books:setHidden(uid, hidden)

purgeImages

Removes every picture layer of a book.

ArgumentTypeDescription
uidstringBook uid

Returns integer, the number of layers removed.

exports.REC_Books:purgeImages(uid)

deleteBook

Deletes a book and its pages. The items stay and say the book is missing.

ArgumentTypeDescription
uidstringBook uid

Returns boolean.

exports.REC_Books:deleteBook(uid)
©2026 RE:CORD Development Group. All rights reserved.