LoadingScreen Won't Delete

Yet another problem, this time is the loading screen…

So the issue here is that it won’t delete, I am positive I wrote it correctly, here is the entire code.

game.ReplicatedFirst:RemoveDefaultLoadingScreen()
local TS = game:GetService("TeleportService")
local ContentProvider = game:GetService("ContentProvider")
local p = game.Players.LocalPlayer
local gui = script.LoadingScreen


math.randomseed(tick())
local customScreen = TS:GetArrivingTeleportGui()
local Tips = {
	"Beware of possible <b>Hazards!</b>",
	"Anomalies might breakout, so take shelter when you hear alarms!",
	"Press <b>M</b> Twice to return back to main menu!",
}

p:WaitForChild("PlayerGui")

gui.Parent = p.PlayerGui
gui.Name = "LoadingScreen"

while true do
		gui.Bottom.Text = Tips[math.random(1,#Tips)]
		wait(4)
		gui.Bottom.Text = Tips[math.random(1,#Tips)]
		wait(4)
end

if game:IsLoaded() then
	game.Players.LocalPlayer.PlayerGui.LoadingScreen:Destroy()
end
1 Like

thats because u use a while loop so the code under the loop dont will run so try using:

game.ReplicatedFirst:RemoveDefaultLoadingScreen()
local TS = game:GetService("TeleportService")
local ContentProvider = game:GetService("ContentProvider")
local p = game.Players.LocalPlayer
local gui = script.LoadingScreen


math.randomseed(tick())
local customScreen = TS:GetArrivingTeleportGui()
local Tips = {
	"Beware of possible <b>Hazards!</b>",
	"Anomalies might breakout, so take shelter when you hear alarms!",
	"Press <b>M</b> Twice to return back to main menu!",
}

p:WaitForChild("PlayerGui")

gui.Parent = p.PlayerGui
gui.Name = "LoadingScreen"

task.spawn(function()
while true do
		gui.Bottom.Text = Tips[math.random(1,#Tips)]
		wait(4)
		gui.Bottom.Text = Tips[math.random(1,#Tips)]
		wait(4)
end
end)

if game:IsLoaded() then
	game.Players.LocalPlayer.PlayerGui.LoadingScreen:Destroy()
end
1 Like

It didn’t work, not sure why though.

1 Like
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
local TS = game:GetService("TeleportService")
local ContentProvider = game:GetService("ContentProvider")
local p = game.Players.LocalPlayer
local gui = script.LoadingScreen

local customScreen = TS:GetArrivingTeleportGui()
local Tips = {
	"Beware of possible <b>Hazards!</b>",
	"Anomalies might breakout, so take shelter when you hear alarms!",
	"Press <b>M</b> Twice to return back to main menu!",
}

p:WaitForChild("PlayerGui")

gui.Parent = p.PlayerGui
gui.Name = "LoadingScreen"

coroutine.create(coroutine.resume(function()
while true do
		gui.Bottom.Text = Tips[math.random(1,#Tips)]
		wait(4)
		gui.Bottom.Text = Tips[math.random(1,#Tips)]
		wait(4)
end
end))
if game:IsLoaded() then
	game.Players.LocalPlayer.PlayerGui.LoadingScreen:Destroy()
end
1 Like

so try this‎ ‏‏‎‎ ‏‏‎‎ ‏‏‎‎ ‏‏‎‎ ‏‏‎

1 Like

image

1 Like

oh srry its:

game.ReplicatedFirst:RemoveDefaultLoadingScreen()
local TS = game:GetService("TeleportService")
local ContentProvider = game:GetService("ContentProvider")
local p = game.Players.LocalPlayer
local gui = script.LoadingScreen

local customScreen = TS:GetArrivingTeleportGui()
local Tips = {
	"Beware of possible <b>Hazards!</b>",
	"Anomalies might breakout, so take shelter when you hear alarms!",
	"Press <b>M</b> Twice to return back to main menu!",
}

p:WaitForChild("PlayerGui")

gui.Parent = p.PlayerGui
gui.Name = "LoadingScreen"

coroutine.resume(coroutine.create(function()
while true do
		gui.Bottom.Text = Tips[math.random(1,#Tips)]
		wait(4)
		gui.Bottom.Text = Tips[math.random(1,#Tips)]
		wait(4)
end
end))
if game:IsLoaded() then
	game.Players.LocalPlayer.PlayerGui.LoadingScreen:Destroy()
end
1 Like

nope, still didn’t workㅤㅤㅤㅤㅤㅤㅤㅤㅤ

1 Like

did u get any error? ‎ ‏‏‎‎ ‏‏‎‎ ‏‏‎

no, I did not see any errors in output.

Instead of game.Players.LocalPlayer.PlayerGui.LoadingScreen:Destroy() do

gui:Destroy()


I tried that also, still didn’t work.

Wait i will try it


Try doing this.

game.Loaded:Wait()
game.Players.LocalPlayer.PlayerGui.LoadingScreen.Frame.Visible = false

This is a script from one of my games.

alright, I will try itㅤㅤㅤㅤㅤㅤㅤㅤㅤ

If not, then I will give you the full script. And a model to it.

repeat task.wait() until game:IsLoaded()
gui:Destroy()


I thing its not working because if the game is not loaded it will not wait to Destroy it but repeat wait will wait until the game is loaded

didn’t work, if it helps here is the layout of the Gui
image

Is it the LoadingScreen Script?

Do this:

repeat task.wait() until game:IsLoaded()
gui:Destroy()

1 Like