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

How do I have multiple Values in one Table Name?

Asked by 8 years ago

Permissions Module Script

local Module = {
    ["CanUse"] = {"TheTravelingHermit","NeutronStarStudios"}
}
return Module

I want to have multiple names in one Value.

for i,p in pairs(VoiceTable) do

if speaker.Name == p then
        Voice Commands Here
end

end

This doesn't work, I have the basics down, I just don't know how to have multiple names in the same Table Value. Please help!

1 answer

Log in to vote
0
Answered by 8 years ago

Assuming that VoiceTable is Module.CanUse, that should be fine.

A better alternative is to use a dictionary

local Module = {
    ["CanUse"] = {
TheTravelingHermit = true;
NeutronStarStudios = true;
}
}
return Module

That way you can find out if somebody is in the CanUse table with the accessor

PlayerCanUse = Module.CanUse[Player.Name]
Ad

Answer this question