Why is my loading screen not working?

Hi! I made this loading screen for a game. I tried to test it by making this map but somehow it’s not working properly. Here’s my gui:

And this is how it’s grouped:
Screenshot (22)

And here’s the local script I provided:

script.Parent:RemoveDefaultLoadingScreen()

local gui = script.ScreenGui
gui.Parent = game.Players.LocalPlayer.PlayerGui

local ConProv = game:GetService("ContentProvider")
local toLoad = workspace:GetDescendants()

local total = #toLoad

for i, v in pairs(toLoad) do
	gui.Frame.AssetLoadingFrame.AssetsLoaded.Text = i.."/"..total.." "..v.Name
	gui.Frame.AssetLoadingFrame.Bar.Size = UDim2.new(i/total, 0, 1, 0)
	ConProv:PreloadAsync((v))
end

for i, v in pairs(game.ReplicatedStorage:GetChildren()) do
	v.Parent = workspace
end
wait(2)
gui:Destroy()

And this is how it looks like when loading:

My problem is that it only stays at 1 for a certain amount of time (mostly more than 10 seconds) because I get an error saying: 18:08:34.637 Unable to cast to Array - Client - LocalScript:14.

If you can fix this it would be very appreciating.

dont use script.Parent, bec the gui will also the clone to the player gui causing the script to have an error.

instead use game.ReplicatedFirst

game:GetService(“ContentProvider”):PreloadAsync()'s first argument is an Array try replacing ConProv:PreloadAsync((v)) with ConProv:PreloadAsync({v}). Do note I am saying this based off what I found on ContentProvider