DirkScripts
Register a context menu that can be opened by ID
lualib.registerContext('my_menu', { title = 'Main Menu', icon = 'fa-bars', options = { { title = 'Option 1', description = 'Does something', icon = 'fa-cog', onSelect = function() print('selected!') end, }, { title = 'Sub Menu', icon = 'fa-arrow-right', arrow = true, menu = 'my_sub_menu', -- opens another registered context }, }, })
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Unique menu identifier |
| data | table | yes | Menu definition (see below) |
| Field | Type | Description |
|---|---|---|
title | string | Menu header title |
icon | string | FontAwesome icon class |
options | table[] | Array of menu options |
| Field | Type | Description |
|---|---|---|
title | string | Option label |
description | string | Subtitle text |
icon | string | FontAwesome icon |
onSelect | function | Callback when selected |
menu | string | ID of a sub-menu to open |
dialog | string | ID of a dialog to open |
args | any | Arguments passed to clientEvent / serverEvent |
clientEvent | string | Trigger a client event when selected |
serverEvent | string | Trigger a server event when selected |
metadata | table | Key-value pairs displayed as badges |
disabled | boolean | Grey out the option |
arrow | boolean | Show a right arrow |
willClose | boolean | Force option to close (or keep open) before callbacks |
Open a registered context menu
lualib.openContext('my_menu')
Close the currently open context menu
lualib.closeContext()
Get the ID of the currently open context menu
lualocal id = lib.getOpenContextMenu()
Show or hide the context menu without destroying it
lualib.showContext() lib.hideContext()

Powered by
All you need for your FiveM server
Copyright Š 2026 DirkScripts.
Not affiliated with or endorsed by Rockstar North, Take-Two Interactive, or any other rights holders. FiveM is a copyright and registered trademark of Take-Two Interactive Software, Inc.
Our checkout system is provided by Tebex Limited, who manage payment processing, product delivery, and billing support. Prices shown in currencies other than GBP are approximate conversions updated daily. All purchases are processed in GBP, so the final amount charged may vary depending on your bank or payment providerâs exchange rate.
Daily dig available!
Hey you, you have free digs waiting