Zylez
|
  |
| Joined: 26 Mar 2016 |
| Total Posts: 417 |
|
|
| 08 Nov 2016 01:25 PM |
I want to transfer all properties from an unknown instance to another. I would like to know if there is any way to obtain the properties and apply them to another. For example:
props = GetProperties("BasePart") for i = 1, #props do workspace.Part1[props[i]] = workspace.Part2[props[i]] end
|
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 08 Nov 2016 01:43 PM |
doing this: part[x] Will get children, not properties. |
|
|
| Report Abuse |
|
|
Zylez
|
  |
| Joined: 26 Mar 2016 |
| Total Posts: 417 |
|
|
| 08 Nov 2016 01:46 PM |
Doing Part["Position"] will get the position of the part.
|
|
|
| Report Abuse |
|
|
VoidFrost
|
  |
| Joined: 14 Oct 2011 |
| Total Posts: 1188 |
|
| |
|
Zylez
|
  |
| Joined: 26 Mar 2016 |
| Total Posts: 417 |
|
|
| 08 Nov 2016 01:52 PM |
So why has roblox not thought about this before? There is even a suggestion with a lot of supporters that was posted 5 years ago: https://forum.roblox.com/Forum/ShowPost.aspx?PostID=43343174
How come this important feature has not been added yet?
|
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 08 Nov 2016 01:53 PM |
The only way I can think of doing it is to either compile a list (or parse the wiki[1]) of all the properties in the game and when faced with an unknown instance to just attempt to read every property. Create a metatable and store the results of all the properties for that instance and look it up.
[1] wiki.roblox.com/index.php?title=Category:Class_properties |
|
|
| Report Abuse |
|
|
UFAIL2
|
  |
| Joined: 14 Aug 2010 |
| Total Posts: 6905 |
|
|
| 08 Nov 2016 01:56 PM |
| My bad you could just parse the relevant wiki page for the instance instead of the whole list. |
|
|
| Report Abuse |
|
|
Zylez
|
  |
| Joined: 26 Mar 2016 |
| Total Posts: 417 |
|
|
| 08 Nov 2016 01:58 PM |
I know there are some modulescripts for getting properties but still, I can't believe roblox never taken it into consideration. I expected it to be obtainable with getfenv
|
|
|
| Report Abuse |
|
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 08 Nov 2016 01:59 PM |
| how would environments have anything to do with objects' properties |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2016 02:16 PM |
| pretty sure the objects are controlled using a function for index and when you try to get all of the items it will not show up because it is not in the table but rather a reference from the index function |
|
|
| Report Abuse |
|
|