Hello
I use this code to make a new loading screen and it works, however, I have noticed I can still see the game while loading, and I don't know how to prevent that.
In the wiki it is said we need to wait for the PlayerGui then insert the loading screen or something like that, I think it's done in this script but I'm not sure.
repeat wait() until game.Players.LocalPlayer:FindFirstChild("PlayerGui")
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
game.Players.LocalPlayer.PlayerGui:SetTopbarTransparency(0)
local ContentService = game:GetService("ContentProvider")
local bar = script.Parent.LoadingFrame.Underlay.Overlay
local logo = script.Parent.Logo
---Start Intro---
script.Parent.Title.Position = UDim2.new(0,0,-1,0)
logo.Position = UDim2.new(0.15,0,-1,0)
script.Parent.LoadingFrame.Position = UDim2.new(0,0,-1,0)
---End Positioning--
---Start Moving Positioning---
script.Parent.Title:TweenPosition(UDim2.new(0,0,0.2,0), "In","Bounce", 2)
script.Parent.LoadingFrame:TweenPosition(UDim2.new(0,0,0.4,0),"In", "Bounce",2)
wait(3)
---Loading Bar Action---
local AmountOfAssestsLoaded = script.Parent.LoadingFrame.AssetsLoaded
local AllAssets = game.ContentProvider.RequestQueueSize
AssetsLoaded = game.ContentProvider.RequestQueueSize
AmountOfAssestsLoaded.Value = game.ContentProvider.RequestQueueSize
while game.ContentProvider.RequestQueueSize > 0 do
if game.ContentProvider.RequestQueueSize < AssetsLoaded then
AmountOfAssestsLoaded.Value = game.ContentProvider.RequestQueueSize
AmountOfAssestsLoaded.Changed:connect(function(assetstoload)
local newx = 1 - AmountOfAssestsLoaded.Value / AllAssets
bar:TweenSize(UDim2.new(0,1,0)"Out","Quad",0.5,true)
end)
end
wait()
end
bar:TweenSize(UDim2.new(1,0,1,0),"Out","Quad",0.5,true)
---End Loading Bar Action---
wait(2)
---Send LoadingBar to the right---
script.Parent.LoadingFrame:TweenPosition(UDim2.new(1,0,.4,0),"Out","Quad",2)
--Send Logo Down--
logo.Visible = true
logo:TweenPosition(UDim2.new(0.35,0,0.5,0),"In","Quint",2)
wait(3)
script.Parent:TweenPosition(UDim2.new(1,0,0,0),"Out","Elastic",2)
script.Parent.Parent.Menu.MenuFrame.Logo.Visible = true
Does anyone know how to do this?
