Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make an asset loading GUI?

I am trying to make a type of GUI Murder Mystery 2 (MM2) Has, but I cannot do it because everything I try doesn't work. I've tried this chunk of code, but it doesn't print he "left of" part, and skips to "All assets loaded!". Is ContentProvider depreciated?

local cp = game:GetService("ContentProvider")
local totalassets = cp.RequestQueueSize

while cp.RequestQueueSize > 0 do
    print(cp.RequestQueueSize .. " left of " .. totalassets .. " assets remaining...")
    wait()
end

print("All assets loaded!")

4 comments

0

I may be wrong on this as I haven't touched ContentProvider in a while but you aren't loading anything into CP's queue until you actually call for an asset. You use :PreloadAsync for this.

0

I read about that and it seems you have to put EVERYTHING into a table to load, is there an easier way to load a game and display the amount of "parts" left to load?

0

If you want to know if an api is deprecated: You could search it up on developer.roblox.com and look for a deprecation box like this onehttps://developer.roblox.com/api-reference/class/HopperBin

0

ContentProvider is used for loading in assets/content. Rendering parts is a whole other thing if that's what you're trying to do.

1 answer

So if you want you can do this but it won't really show how much assets there are.

  1. You want to make the gui
  2. Put a local script in Replicated First
  3. put the gui in the local script then in the script you put in the following:
game.ReplicatedFirst:RemoveDefaultLoadingScreen()

local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
PlayerGui:SetTopbarTransparency (0)

local GUI = script['Whatever the name of the gui is"]:Clone()
GUI.Parent = PlayerGui

repeat wait(1) until game:IsLoaded()
GUI.Frame:TweenPosition(UDim2.new(0,0,1,0), "InOut","Sine",0.5)
wait(0.5)
GUI:Destroy()

Hope this helped. (:

Btw Tween position is not really needed it just adds a cool effect before being destroyed.

This discussion is preserved as it was. New answers, comments, and votes are closed.