Multiple instances for 1 variable

I am using ZonePlus in order to make my tesla gate work, and I want to keep my code short, so instead of having multiple variables, I’d like to have only 1 variable for multiple instances, which I will use for Zone.new()

Unfortunately, I’ve looked all over and have not found a solution.

What do you mean 1 variable for multiple instances? Do you mean you want to create a zone with multiple parts in it?

No, like 1 variable referring to multiple parts named “Zone”

You can’t really refer to multiple parts with just one variable, you can however just store your zone parts in a single folder. And use that folder or the individual parts for your zones

Maybe use a table to store all the instances in? Then use keys to reference the values inside.

local ZoneTable = {Gate = SomePart, Inside = AnotherPart}

print(ZoneTable.Gate)
print(ZoneTable.Inside)

After looking at the API for ZonePlus, Zone.new() does accept tables. So you could just use the table as its argument.

local ZoneTable {FirstPart, SecondPart, ThirdPart}
local zone = Zone.new(ZoneTable)