How to create adjacent part placement efficiently?

I’ve been attempting to recreate a very old map generation game for my friend in teamcreate lately and as of right now I’m actually sort of stuck on the start of it. By that I mean creating the seabed by creating part instances and then adjusting the positions of them to be adjacent to one another. The way I’m doing it right now is extremely inefficient (and the current code downright doesn’t even work, probably because of either a teamcreate bug i ran into or I’m just misguiding myself with one of those client/server sided localization errors again) and I’d like to improve it (I’ve done the copy-paste method before instead of the clone method but that’s even more inefficient and could cause lag in large quantities).

Here’s the current code as of right now:


Don’t know if this qualifies into going to Code Review instead even though im technically making errors but oh well.

If anyone has a solution they could bring to the table it would be appreciated.

One of your issues is that you aren’t parenting the cloned parts. When you use :Clone() it doesn’t automatically parent the clone, and you must do that yourself.
For the other issue try adding to the position of the original baseline part