How to make BindToRenderStep to wait for an InvokeServer?

I have all my MeshParts stored in ServerStorage.
When I need a specific part (in LocalScript), I call a RemoteFunction:

local partReplicatedStorage = ReplicatedStorage:WaitForChild("RemoteFunction"):InvokeServer(partName) 

In Server, if it is the FIRST TIME the MeshPart is requested, the script puts it in ReplicatedStorage:

local function LoadObject(player, partName)
	local part = game.ReplicatedStorage:FindFirstChild(partName)
	if not part then -- if not found in ReplicatedStorage...
		part = game.ServerStorage:FindFirstChild(partName)
		if part then part.Parent = game.ReplicatedStorage end -- puts the part in ReplicatedStorage
	end
	return part
end

ReplicatedStorage:WaitForChild("RemoteFunction").OnServerInvoke = LoadObject

It works ok, but when I call it inside a BindToRenderStep function, it’s taking almost 5 frames to return the valid object inside ReplicatedStorage.

For example, inside my BindToRenderStep function (LocalScript), for each frame, I have this:

print("BEFORE InvokeServer")
local partReplicatedStorage = ReplicatedStorage:WaitForChild("RemoteFunction"):InvokeServer(partName) 
print("AFTER InvokeServer")

In the example above, I’ll get AFTER InvokeServer message only before the 5th frame…

BEFORE InvokeServer
BEFORE InvokeServer
BEFORE InvokeServer
BEFORE InvokeServer
BEFORE InvokeServer
AFTER InvokeServer

What can I do to force my BindToRenderStep function to wait until the object replicated from the server becomes available in ReplicatedStorage?

BindToRenderStep is not the right thing to use in this case. It will fire every frame, regardless of whether the previous request has finished or not. Instead, since InvokeServer yields, you can just use a while or for loop. A loop does not continue or jump ahead until the current task finishes.

Example:

for num, partName in pairs(PartNamesToLoad) do
    local partReplicatedStorage = ReplicatedStorage:WaitForChild("RemoteFunction"):InvokeServer(partName) 
end

Also, wouldn’t it be better to use one InvokeServer, containing a table of items to load, instead of sending each part in a individual request? This way you could cause the server less stress, while getting the task done faster.