How to save two informations in a Table

Hello, guys! I’m doing a gang system and to save the gangs I’m using a table. But in my gang system have gang name and gang password so how to I (in a table) insert two informations? Like the gang name and the gang password. Furthermore, I need to save the table in a GlobalDataStore or just in a DataStore?

local GangHandler = {}
local GangTable = {
	DevGang = "123"

function AddGang(Name, Password)
	if Name ~= nil and not Name:match("%s") then
		table.insert(GangTable, Name)

return GangHandler

Try something like table.insert(GangTable, {Name, Password}).

1 Like

Ok, im going to try it. Can this works too?

function AddGang(GangName, Password)
	if GangName ~= nil and not GangName:match("%s") then
		table.insert(GangTable, GangName)
		if Password ~= nil and not GangName:match("%s") then
			GangTable[GangName] = Password

Yes, but not as efficient as my own, since mine requires less lines.

1 Like