Cadburry ScriptsCadburry Scripts

Export

Quality of life scripts for your FiveM server. Performance optimized resources that install in minutes, with free updates and support that actually answers.

The cad-notepad resource provides utility exports to manage the notepad UI, including toggling visibility and checking its open state.

IsOpen

Checks whether the notepad is currently open.

exports['cad-notepad']:IsOpen()

Returns:

  • boolean – true if the notepad is open, false otherwise.

Usage:

lua
if exports['cad-notepad']:IsOpen() then
  print("Notepad is currently open")
end

ToggleNotepad

Toggles the notepad UI for the player. Optionally forces it open.

lua
exports['cad-notepad']:ToggleNotepad(data, force)

Parameters:

  • data (table, optional) – Pass any relevant information for the notepad (e.g., prefilled content)

Key

Type

Description

slot

number

Slot index of the notepad

paragraph

string

Text content to display

drawing

string

JSON string of canvas drawing data

signature

string

Name or signature of the user

coords

vector3

(Optional) Position where note was created

disabled

boolean

If true, sets the notepad to read-only mode

force

boolean

(Optional) Force open, even if already open

  • force (boolean, optional) – If true, forces the notepad to open regardless of current state.

Example:

lua
exports['cad-notepad']:ToggleNotepad({
  slot = 0,
  paragraph = "Initial field notes for investigation.",
  signature = "Officer R. Singh",
  coords = vector3(-334.9, -1040.5, 76.88),
  drawing = "{\"lines\":[{\"points\":[{\"x\":83.70,\"y\":296.85},{\"x\":85.29,\"y\":295.26},{\"x\":91.46,\"y\":285.40}...],\"brushColor\":\"#161616\",\"brushRadius\":1}],\"width\":400,\"height\":400}",
  disabled = true
}, true)

Server β†’ Client: cad-notepad:toggle

Triggers the notepad from the server side.

lua
TriggerClientEvent('cad-notepad:toggle', source, data, force)

Parameters:

  • source (number) – Player's server ID.

  • data (table, optional) – Same as ToggleNotepad.

  • force (boolean, optional) – Force toggle on the client.

Example:

lua
TriggerClientEvent('cad-notepad:toggle', src, { text = "Server-pushed note" }, true)
Last updated Cadburry Scripts