local optionsLocked = {
["Option1"] = false,
["Option2"] = true,
["Option3"] = true,
["Option4"] = false,
["Option5"] = false,
}
-- example usage:
if optionsLocked["Option1"] then
Options.Option1.Lock.Visible = true
end
In this example, optionsLocked is a table that maps option names to booleans, where a boolean value of true indicates that the option is locked, and false indicates that it is not locked.
In the provided example of usage, if Option1 is locked (as specified in the optionsLocked table), then the Visible property of the lock object (presumably somewhere in the Options object) will be set to true.
You can use this method to easily manage which options are locked or unlocked, and it can be easily extended to include additional options.
You can create tables for boolean values like so. Using entire tables dynamically is done with a “for loop” iterating over pairs(OptionsLocked)
local OptionsLocked = {
["Option1"] = false,
["Option2"] = true,
["Option3"] = true,
["Option4"] = true,
["Option5"] = false,
}
for key, value in pairs(OptionsLocked) do
local object = Options:FindFirstChild(key)
object.Lock.Visible = value
end