How to change a property by only getting the property name?
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.
01 | function AddProperty(PropertyTable,Obj) |
02 | Obj [ PropertyTable.Name ] = PropertyTable.Value |
05 | function CreateObject(Type,Properties) |
06 | local Obj = Instance.new(Type,game:GetService( "Workspace" )) |
08 | for i = 1 ,#Properties do |
09 | local PropertyTable = Properties [ i ] |
10 | AddProperty(PropertyTable) |
14 | CreateObject( "Part" , { { Name = "Size" , Value = Vector 3. 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.