DirkScripts
âšī¸ Shared Module - This can be used by both clients and the server
Used to quickly copy a table, useful for global state values
lualocal copiedTable = lib.table.deepClone(table)
| Parameter | Type | Required | Description |
|---|---|---|---|
| table | Object, Array | true | Table to be copied |
Check through a table for a set key
lualocal foundData = lib.table.findKeyInTable(tbls, key)
| Parameter | Type | Required | Description |
|---|---|---|---|
| tbls | String, Object | true | Table to be searched |
| key | String, Number | true | Key to be found |
Check if a value is present in a table
lualocal found = lib.table.includes(table, value, recursive)
| Parameter | Type | Required | Description |
|---|---|---|---|
| table | Object, Array | true | Table to be searched |
| value | Object | true | Value to be found |
| recursive | Boolean | false | Check sub tables too |
Convert data to different formats
lualocal data = lib.table.convert(_type, data)
| Parameter | Type | Required | Description |
|---|---|---|---|
| _type | String | true | Type of data - vectors, items_sql, string, item_ox, convert_idexes |
| data | Any | true | Data to be converted |
Count entries in a table (works with non-sequential keys)
lualocal count = lib.table.count(table)
| Parameter | Type | Required | Description |
|---|---|---|---|
| table | table | yes | Table to count |
Deep-merge two tables. Keys from t2 overwrite keys in t1.
lualocal merged = lib.table.merge(t1, t2, addDuplicateNumbers)
| Parameter | Type | Required | Description |
|---|---|---|---|
| t1 | table | yes | Base table |
| t2 | table | yes | Table to merge in |
| addDuplicateNumbers | boolean | no | If true, adds numeric values instead of overwriting |
Remove all entries from a table in-place
lualib.table.wipe(tbl)
| Parameter | Type | Required | Description |
|---|---|---|---|
| tbl | table | yes | Table to wipe |
Make a table read-only (errors on write)
lualocal frozen = lib.table.freeze(tbl)
| Parameter | Type | Required | Description |
|---|---|---|---|
| tbl | table | yes | Table to freeze |
Deep-compare two tables for equality
lualocal equal = lib.table.compare(t1, t2)
| Parameter | Type | Required | Description |
|---|---|---|---|
| t1 | table | yes | First table |
| t2 | table | yes | Second table |
Check if a table is a sequential integer-indexed array
lualocal isArr = lib.table.isArray(tbl)
| Parameter | Type | Required | Description |
|---|---|---|---|
| tbl | table | yes | Table to check |

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.