Okay, this is just an example of what I intend to use this for. I plan on using something like this to edit GUIs when the mouse enters, leaves or clicks it. For now I'm just testing it out so... I want data[Workspace.BasePlate].Properties to equal data[Workspace.Part].Properties. How can I reference it from inside the table without typing it twice?
01 | local data = { |
02 | [ Workspace.Part ] = { |
03 | Properties = { |
04 | [ "BrickColor" ] = "Lime green" , |
05 | [ "Material" ] = "DiamondPlate" |
06 | } |
07 | } , |
08 | [ Workspace.BasePlate ] = { |
09 | Properties = { } -- I want the properties here to be the same as Part's |
10 | } , |
11 | } |
You can't do this on the initial "set" operation. However, you can do it like this:
01 | local data = { |
02 | [ Workspace.Part ] = { |
03 | Properties = { |
04 | [ "BrickColor" ] = "Lime green" , |
05 | [ "Material" ] = "DiamondPlate" |
06 | } |
07 | } , |
08 | } |
09 |
10 | data [ Workspace.BasePlate ] = { |
11 | Properties = data [ Workspace.Part ] .Properties |
12 | } , |