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

Is it possible to make something load LAST?

I am making a custom loading GUI, and I was trying to make it so it only goes away when everything has loaded. Since I'm not a master at coding, my first thought was to just make the loading GUI stay up until a certain brick has loaded. I want this brick to load last, so I know that everything has loaded. I got the code from the ROBLOX Wiki, and this is what I have so far:

local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
PlayerGui:SetTopbarTransparency(0)
 
local screen = Instance.new("ScreenGui")
screen.Parent = PlayerGui
 
local textLabel = Instance.new("TextLabel")
textLabel.Text = "Loading"
textLabel.Size = UDim2.new(1,0,1,0)
textLabel.FontSize = Enum.FontSize.Size14
textLabel.Parent = screen
 
script.Parent:RemoveDefaultLoadingScreen()
 
local count = 0
repeat
textLabel.Text = "Loading " .. string.rep(".",count)
until --this is where i'd put "workspace:WaitForChild("brick")", and that brick would be the last thing to load

 
screen.Parent = nil

can anyone help?

4 comments

0

this isn't possible. I'm pretty sure roblox automaticly waits for everything to load before spawning the character.

0

That is what I thought, but when I join a game, usually Decals and textures and stuff aren't fully loaded yet, and certain things a grey. I've seen loading screens that wait for things not to be grey, so I was wondering,

0

Use PreloadAsync in ContentProvider. The function yields until all of it loads.

0

Study PreloadAsync, this is what you'll need for loading assets. I'm no master at this, I'm quite new to it so I have to practice myself on this.

1 answer

✓ Accepted answer

Hiimgoodpack is right. Use PreloadAsync in ContentProvider. The function yields until all of it loads. after that, the function will then work. If this helped, accept it as answer underneath this answer. If not, ask me for more details and I will gladly help. Good luck with your loading last XD

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