Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to check boolean in table with a corresponding name?

Hi. I'm making a keycard system and I need to know how to read a table that works something like this

local cards = {
	["a"] = true,
	["b"] = true,
	["c"] = true,
	["d"] = false,
	["e"] = true,
	["f"] = false
}

and return if it's true or false, and call it for any of the keycards. I really can't get my finger on how to do this, and any help would be appreciated! Thanks!

1 answer

Figured it out myself.

for i, v in ipairs(cards) do
	if v[plr.Name] == true then
		print("e")
	end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.