Ok so I did'nt really know what to call the title, but I was having a function that could create a part and you pass trough some properties but instead having a varible in the funcation for every poropertie. I wanted to make a table with all properties in it. I tried this.
function AddProperty(PropertyTable,Obj) Obj[PropertyTable.Name] = PropertyTable.Value end function CreateObject(Type,Properties) local Obj = Instance.new(Type,game:GetService("Workspace")) for i = 1,#Properties do local PropertyTable = Properties[i] AddProperty(PropertyTable) end end CreateObject("Part",{{Name = "Size", Value = Vector3.new(10,10,10)}})
But when I type "Obj[PropertyTable.Name]" it tries to find a object inside the object with that name. Not changing the propertie. Is there any way to do this without using loadstring becuase I cant seem to be able to use it anymore.