Spawned batches of parts stop replicating to client after first few batches

So, Im spawning a ton of parts in batches (I wait() between each) when the server is created, to generate some stuff (parent part, position part, :MakeJoints()). They end up being grounded to an anchored part.

I just increased the number of batches (just change a single integer to a higher value), and it appears only the first few batches of parts appear on the client (shift+F1 shows like 1/4 the primitives, than what a print from the server tells me there are, plus, of course, I dont see the missing ones). Possibly the ones that are created before player joins (as without waits, all the parts will be generated before player joins, and it works fine in that case)

When spawning the parts, I printed part count on server before and after, and they are correctly added there (and again, server prints that they are still there, so theyre not disappearing or anything).

They just never arrive on the client…?

Im talking about 13k parts spawned over ~2 seconds (.1 second wait between batches) one by one with some laggy processing going on as well.
Only 3-4k parts arrive on the client (the first 3-4k). Also, it cuts off after one of the waits (not in middle of a batch).

So theres a point where after the script yields and later resumes, the following batches of parts no longer replicate to client at all, even though they exist on server.

I will see if adding longer waits has any effect…

EDIT:
no, the INSTANCES seem to replicate, but the primitives themselves do not show up.
EDIT2:
though that could just be the joint/weld instances, maybe?
EDIT3:
removing the waits ‘solves’ problem (not anymore) (maybe something to do with player joining while its spawning the stuff? Im teleporting to the place after reserving it), (the bugs still there, tho)

Bump, because I no longer can remove the wait to solve the issue (takes too long and I can never join the server in the end…)

So, I must bring back the waits.

But this bug prevents it.

A new observation:
Its only the regular parts that dont show up on the client.
I have some unionparts, and those show up. And float midair. On the server theyre welded to the regular parts. On the client the regular parts arent there.

I assume its because the stuff is being spawned while the player is loading the place (plus some influence from high performance load of the process).

(some of the things on the right are single union, others are multiple unions welded together in a model. Also, I do see a single regular part inside one of the models, so idk what the logic is there)
(also, when i say “welded to bottom of building”, I dont mean a direct weld, just :MakeJoints() keeping the thing together)

Edit:
I tried adding 10 second wait before I start spawning (so the player has time to enter, and wait for a while). But they still dont appear on client.

I assume it works without yielding, because everything is generated before the player actually joins (so they can then load all the things on joining)

The parts are all in the same folder (individual parts), parented there one by one (thousands), maybe that messes with it…? But I cant change that without breaking everything :confused:

EDIT:
I made it wait every 10th part. No bug.
Then I made that every 50th. Bug again.

So it seems if I try to replicate more than a few parts at a time, itll fail.

Assuming this wont be fixed within the next 6 months, is there something I can change in my approach that might avoid this issue immediately?

Is there some action I can do to ‘force’ the parts to replicate to the client? I assume something like changing their appearance wouldnt work (that wouldnt replicate the entire part, would it?)

I tried toggling their transparency to 1 and back to 0 the next frame, but that didnt work.