TableCare V-1.0.3, module to manage tables more easier

Documentation :floppy_disk: | Source Code :hammer: | Get Model :gift:

TableCare is a module to manage your tables more easier. You can use functions to save tables, use tables in another scripts easier and more.

:link: | :robot: API


:sparkles: Exemples


Setup:

Check similar values between two tables:

local TableCare = require(game:GetService("ReplicatedStorage").TableCare)
local table1 = {"banana", "apple", "berry", "mouse", "dog", "horse"}
local table2 = {"apple", "cat", "mouse", "fox", "fly", "give"}

local common_elements = TableCare.checksimilar(table1, table2) -- return a table.
for index, value in pairs(common_elements) do print(value) end

{BBDB3FA9-3891-46EE-9FFD-BDF75F2D0DCF}.png

Delete every target elements in a table:

local TableCare = require(game:GetService("ReplicatedStorage").TableCare)
local table1 = {"banana", "apple", "berry", "mouse", "dog", "berry", "horse", "berry"}

table1 = TableCare.deleteall(table1, "berry")

for index, value in pairs(table1) do
	print(value)
end

image

Fusion two tables:

local TableCare = require(game:GetService("ReplicatedStorage").TableCare)
local table1 = {"banana", "apple", "berry", "mouse", "dog", "horse"}
local table2 = {"orange", "cat", "ari", "fox", "fly", "give"}


table1 = TableCare.kiss(table1, table2)
for index, value in pairs(table1) do print(value) end

image

Save a table to use this table in another scripts:

local TableCare = require(game:GetService("ReplicatedStorage").TableCare)
local table1 = {"banana", "apple", "berry", "mouse", "dog", "horse"}

local save_id = TableCare.save_table(table1, 1, false)

In another script:

local TableCare = require(game:GetService("ReplicatedStorage").TableCare)
local copy_table = {}
wait(2)

copy_table = TableCare.load_table(1, copy_table)

for index, value in pairs(copy_table) do
	print(value)
end

image

If you want to unload the table, try the function TableCare.unload_table(bind_id):

local TableCare = require(game:GetService("ReplicatedStorage").TableCare)
wait(1)
TableCare.unload_table(1)

To get all loaded tables, you can try:

local TableCare = require(game:GetService("ReplicatedStorage").TableCare)
local storage_loaded = TableCare:GetLoadedTables()

And if you want to clear all loaded tables, then use the function TableCare:ClearLoadedTables()

local TableCare = require(game:GetService("ReplicatedStorage").TableCare)
TableCare:ClearLoadedTables()

More exemples in the documentation.


:pushpin: Update Logs:


V-1.0.0

  • Created the script.
  • Added kiss function.
  • Added checksimilar function.
  • Added deleteall function.
  • Added clearwithout function.
  • Added save_table function.
  • Added load_table function.
  • Added unload_table function.
  • Added random_id function.
  • Added get_length function.
  • Added GetLoadedTables function.
  • Added LoadCareFor function.
  • Added UnloadCareFor function.
  • Added TrackIndexPlayer function.
  • Added UntrackIndexPlayer function.
  • Added TrackIndexInstance function.
  • Added UntrackIndexInstance function.
  • Added TrackToFunction function.
  • Added ChangeIdentity function.
  • Added PermanentLockToAccess function.
  • Added SetDefaultIndex function.
  • Added GetTrackedEvents function.
  • Added ClearLoadedTables function.
  • Added ClearTrackedEvents function.
  • Added Signal module by stravant.
  • Added MIT License.

V-1.0.1

  • ChangeIdentity function don’t switch between 2 tables bug patch.
  • Added private functions to optimize the module.

V-1.0.2

  • The metatables for the function LoadCareFor() are now stable.
  • The table.deleteall() function is back.
  • When a table is permanent lock and you call a function using the metatable, it will return a warn in the output and return the table and args…
  • Added arguments for the :UntrackIndexInstance and the :UntrackIndexPlayer functions.
  • Erased metatables bug patch.
  • WorkonClient delete → Client can use the module, you can’t disable this.
  • Added meta_save function (When save, you can load the table one time and after, the saved table will be deleted [Like a temporary table.])
  • Added comparators for the function TableCareFor(table).
  • Added SetIndexFunction.
  • Added UntrackToFunction to untrack a tracked function.

6 Likes

V-1.0.1

  • ChangeIdentity function don’t switch between 2 tables bug patch.
  • Added private functions to optimize the module.

V-1.0.2

  • The metatables for the function LoadCareFor() are now stable.
  • The table.deleteall() function is back.
  • When a table is permanent lock and you call a function using the metatable, it will return a warn in the output and return the table and args…
  • Added arguments for the :UntrackIndexInstance and the :UntrackIndexPlayer functions.
  • Erased metatables bug patch.
  • WorkonClient delete → Client can use the module, you can’t disable this.
  • Added meta_save function (When save, you can load the table one time and after, the saved table will be deleted [Like a temporary table.])
  • Added comparators for the function TableCareFor(table).
  • Added SetIndexFunction.
  • Added UntrackToFunction to untrack a tracked function.

I’d advise you re-do your examples. None of the vids shown actually show any of the module’s functions in action. Lots of errors before anything at the end of them.

1 Like

Okay I did this, thanks for this comment. I will add more examples soon.

Isn’t this already made? I thought there was one called Table Util.
Still. Cool module!

1 Like

I don’t know this module, sorry ^^’

V-1.0.3

Fixed “not statements”