Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I make an asset loading GUI?

Asked by 6 years ago
Edited 6 years ago

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!")
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. xPolarium 1388 — 6y
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? TheGreenSuperman 85 — 6y
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 xPolarium 1388 — 6y
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. xPolarium 1388 — 6y

1 answer

Log in to vote
0
Answered by 4 years ago

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.

Ad

Answer this question