I have a piece of code that modifies certain property from a lot of different variables linked to instances, but typing each variable + property is a PITA. Any way to compact it? I can't figure out if it's possible to just use a single variable to change them all.
Thanks!
local s = script.Parent
local A1, A2, A3, A4 = s.A1, s.A2, s.A3, s.A4
local backpack = game.Players.LocalPlayer.data.backpack -- backpack is a StringValue
if backpack then
if backpack.Value == "None" then
A1.Visible, A2.Visible, A3.Visible, A4.Visible,
A1.Active, A2.Active, A3.Active, A4.Active =
false, false, false, false, false, false, false, false
end
end
-- Is there a way to compact A1 through A4 Visible and Active properties' code? Can I only type false one time instead of 8 times?

2 comments
Can a array be called a list?
Thank you!