Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i create custom properties for 100s of the same blocks and keep functionality individualised?

Asked by
Gunt_r 31
4 years ago

I currently have around 700 almost identical parts in my project to which i need to add custom destruction logic too. I need to have them acting independantly, for example if one part gets destroyed, only that specific part gets destroyed. The only difference between the parts is their location on a grid that i have constructed.

Initially i thought of using dynamic variables to get past this, but after quite abit of research found that they were heavily frowned upon and that i couldnt even call the variable up anyways.

I then looked into the metatable stuff but cant exactly see a solution there, but i might be wrong.

I need a way to wrap each part with my own custom properties, and have it so that each wrapped part is individualised and doesnt take down the other identical parts down with it too due to them all having the exact same properties.

Im just wondering how i would be able to do this without manually creating functionality for 700+ instances.

If someone has an idea of how i would be able to do this and requires a snippet of my code, just ask and ill pastebin it.

Thanks

0
Do you know about Coroutines and the Collection Service? aquathorn321 858 — 4y
0
Actually before I answer, could I see your code? I'm not exactly sure what kind of functionality you're looking for. If you're just trying to keep track of individual parts on a grid you could use nested tables to represent the grid aquathorn321 858 — 4y
0
I looked into coroutines but they arent what im looking for. However, the collection service looks extremely promising for what i want to do. I will definitely look into them to see if i can use them as a solution. im currently using nested tables to represent the grid. Gunt_r 31 — 4y
0
I wont bother posting my code because the leads you gave me are most likely going to provide a solution. Gunt_r 31 — 4y

1 answer

Log in to vote
0
Answered by
Gunt_r 31
4 years ago

Solution will most likely be found by using the collection service with tags.

Will update if i cant work it out.

Ad

Answer this question