Is there a way to check if a model has replicated fully to the client?

Hello,

I have a childAdded event listening to models being added on the client. Before I start utilising the model, I have to make sure the model’s children have fully loaded and I do not want anything to be hardcoded as I have right now.

Right now, I basically have a :WaitForChild(“replicatedPart”, 2) under the childAdded which does the job but you do need that “replicatedPart” and I do not want that. Without the waitforchild, the model’s children aren’t loaded by the time the listener fires and the Model’s Children amount to 0.

I want it to be “automated” and try to avoid using remotes, is there a way to do this please?

1 Like

What?!?


You use WaitForChild to wait for children.

From what I have experimented with, you may just have to use WaitForChild, im not sure if there are any other alternative methods.

Yes the child is the model and then I have a Model:WaitForChild(“ReplicatedPart”,2)

I might have explained it badly xd

good that is exactly what you are supposed to do.

This sentence is what makes no english.

It does do the job but you need a defined “replicatedPart” within the model which I want to avoid. Hence, I posted here to see if there might be an alternative.

I’m not sure what you mean “you need a defined “replicatedPart””.

it does not have to be called “replicatedPart” or anything specific.

I know.

I just want to know whether the model’s children have replicated without needing a model’s child’s name (in this case it’s “replicatedPart”) if that makes sense.

Are you trying to load the whole game or just 1 model?

Okay but that will not tell you whether a models children replicated, that will tell you if there a part called “replicatedPart” replicated (unless all models children replicate at the same time so if one exists then the rest exists idk, but then I see what your problem is)

The server parents the model to workspace, I have a childAdded event on client but when it fires the model’s children amount to 0, once the model replicates I want to do something with it such as tweening it.

you could use

repeat wait() until #model:GetChildren() >= childamount
--code

to make sure that the children are available, if that’s a solution to your problem.

I did have that in mind but I try to avoid polling based approaches.
Another thing is that the childamount varies since I’m going to have different models so I’d have to give that some thought as well.

Should edit GetChildren to GetDescendants. This would mean that all assets are loaded in the model instead of just the first line of assets under the model.

There is a service for that. It isn’t quite well known. ContentProvider can be used for checking the loading of assets into a game. Simply put the model in PreloadAsync() in a list and it will wait for it too load.

It works with Decals and Sounds too.

ContentProvider | Roblox Creator Documentation.

It’s usually used for loading screens in other cases use WaitForChild()

Now I feel stupid, ContentProvider slipped my mind. Woops!

Yeah. I usually use ContentProvider for loading screens as it allows time for textures to load into the game.

This is actually code I have for it.

for i, children in pairs(workspace:GetChildren()) do 
	pcall(function() -- ContentProvider sometimes fails.
		textLabel.Text = "Loading: "..children.Name
		ContentProvider:PreloadAsync({children})
	end)
end

I’m replying to the title of your topic.

There is ONE way to see if a model has replicated fully to the client…

The o u t p u t