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:
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.