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

Why won't my custom loading screen load?

Asked by
OniiCh_n 410 Moderation Voter
9 years ago

Instead of my custom made loading screen , I'm getting the default loading screen (the black screen, w/ info at the bottom left and pulsating "R" in bottom right)

Here's my code, and some GIFs of what should be happening

Code within a local script, within ReplicatedFirst (The ScreenGui is located within the script itself)

local RF = game:GetService("ReplicatedFirst")
RF:RemoveDefaultLoadingScreen()

local screen = script:WaitForChild("LoadingScreen"):Clone()
local frame = screen:WaitForChild("Frame")
screen.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

while game.ContentProvider.RequestQueueSize > 0 do
    wait(2)
end

if game.ContentProvider.RequestQueueSize == 0 then
    frame:TweenPosition(UDim2.new(0, 0, 1, 0, "Out", "Quad", 1, true, nil))
    frame.Visible = false
end

GIF of normal loading screen loading

GIF of what the loading GUI looks like, and what happens

EDIT: withing isn't a word

1
I've also been having problems with this, it's as if the method RemoveDefaultLoadingScreen has been disabled by ROBLOX. Does anyone know for sure what's up? deaththerapy 60 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

On line 13 is where there is an error, you closed the UDim2.new() at the end of the Tween, instead of after the fourth value.

Fix:

local RF = game:GetService("ReplicatedFirst")
RF:RemoveDefaultLoadingScreen()

local screen = script:WaitForChild("LoadingScreen"):Clone()
local frame = screen:WaitForChild("Frame")
screen.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

while game.ContentProvider.RequestQueueSize > 0 do
    wait(2)
end

if game.ContentProvider.RequestQueueSize == 0 then
    frame:TweenPosition(UDim2.new(0, 0, 1, 0), "Out", "Quad", 1, true, nil)
    frame.Visible = false
end

Ad

Answer this question