Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to read bool from table?

Asked by 3 years ago

Hi, I'm working on a key card door system, and when the key card reader is touched, I would like the function to return true or false, reading from a table that looks like this:

local cards = {
    ["a"] = false,
    ["b"] = true
}

I can't quite figure it out, and any help would be appreciated.

1 answer

Log in to vote
0
Answered by 3 years ago

Figured it out myself, just run cards[hit.Parent.Name]

Ad

Answer this question