DirkScripts Logo

Login With FiveM

Login

📚 Dirk Lib
â€ē
Modules
â€ē

table

Table

â„šī¸ Shared Module - This can be used by both clients and the server

lib.table.deepClone

Used to quickly copy a table, useful for global state values

lua
local copiedTable = lib.table.deepClone(table)
Parameter TypeRequiredDescription
tableObject, ArraytrueTable to be copied

lib.table.findKeyInTable

Check through a table for a set key

lua
local foundData = lib.table.findKeyInTable(tbls, key)
Parameter TypeRequiredDescription
tblsString, ObjecttrueTable to be searched
keyString, NumbertrueKey to be found

lib.table.includes

Check if a value is present in a table

lua
local found = lib.table.includes(table, value, recursive)
Parameter TypeRequiredDescription
tableObject, ArraytrueTable to be searched
valueObjecttrueValue to be found
recursiveBooleanfalseCheck sub tables too

lib.table.convert

Convert data to different formats

lua
local data = lib.table.convert(_type, data)
Parameter TypeRequiredDescription
_typeStringtrueType of data - vectors, items_sql, string, item_ox, convert_idexes
dataAnytrueData to be converted

lib.table.count

Count entries in a table (works with non-sequential keys)

lua
local count = lib.table.count(table)
ParameterTypeRequiredDescription
tabletableyesTable to count

lib.table.merge

Deep-merge two tables. Keys from t2 overwrite keys in t1.

lua
local merged = lib.table.merge(t1, t2, addDuplicateNumbers)
ParameterTypeRequiredDescription
t1tableyesBase table
t2tableyesTable to merge in
addDuplicateNumbersbooleannoIf true, adds numeric values instead of overwriting

lib.table.wipe

Remove all entries from a table in-place

lua
lib.table.wipe(tbl)
ParameterTypeRequiredDescription
tbltableyesTable to wipe

lib.table.freeze

Make a table read-only (errors on write)

lua
local frozen = lib.table.freeze(tbl)
ParameterTypeRequiredDescription
tbltableyesTable to freeze

lib.table.compare

Deep-compare two tables for equality

lua
local equal = lib.table.compare(t1, t2)
ParameterTypeRequiredDescription
t1tableyesFirst table
t2tableyesSecond table

lib.table.isArray

Check if a table is a sequential integer-indexed array

lua
local isArr = lib.table.isArray(tbl)
ParameterTypeRequiredDescription
tbltableyesTable to check

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.