Hey all. So i have a loading gui, that makes use of the ContentProvider. And there are two values. One is the total amount of assets that need to be loaded in. And the other value is how many assets has loaded in. And when i run the game, the number that counts how many assets have loaded in starts at a negative number. Why is this? Some help will be very much appreciated!
Local Script:
ReplicatedFirst = game:GetService("ReplicatedFirst")
ReplicatedFirst:RemoveDefaultLoadingScreen()
local mouse = game.Players.LocalPlayer:GetMouse()
WalkSpeed = 10
script.Parent.MainFrame.Visible = true
wait(1)
P = game.Players.LocalPlayer
H = P.Character:WaitForChild("Humanoid")
H.WalkSpeed = 0
H.JumpPower = 0
local cp = game:GetService("ContentProvider")
local partsToLoad = cp.RequestQueueSize
script.Parent.MainFrame.LoadingFrame.LoadingText2.Text = "Loading Map"
print("Loading Map")
spawn(function()
cp:PreloadAsync({workspace})
end)
script.Parent.MainFrame.LoadingFrame.LoadingText2.Text = "Loading GUIs"
print("Loading GUIs")
spawn(function()
cp:PreloadAsync({game:GetService("GuiService")})
end)
while cp.RequestQueueSize > 0 do
wait(0.1)
print("Loading Assets: "..partsToLoad-cp.RequestQueueSize.." / "..partsToLoad)
script.Parent.MainFrame.LoadingFrame.LoadingText2.Text = "Loading Assets: "..partsToLoad-cp.RequestQueueSize.." / "..partsToLoad
end
