local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local contentprovider = game.ContentProvider
local finished = false
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
while wait() do
script.Parent.Loading.Loading.Text = "Loading Assets: ".. contentprovider.RequestQueueSize
if script.Parent.Loading.Back.MouseButton1Click:Connect() or contentprovider.RequestQueueSize == 0 then --This is the line
wait(3)
game.Lighting.Ping:Play()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
local cam = workspace.CurrentCamera
cam.CameraType = "Scriptable"
local selected = workspace:WaitForChild("IntroCamera")
cam.CameraSubject = selected
cam.CFrame = selected.CFrame
PlayerGui:SetTopbarTransparency(0)
script.Parent.Loading.Visible = false
game.Lighting.MenuBlur.Size = 25
wait(1)
game.Lighting.Ping:Play()
game.Lighting.Menu:Play()
script.Parent.Menu.Main.Visible = true
game.Lighting.ButtonsEnabled.Value = true
break
end
end
I have this loading screen and I have added a skip button, now I want to check if the button got clicked or if the game has loaded at the same time (3rd line in the while loop), but adding a button click to the if statement doesn’t seem to work in any way. Now I wanted to ask if anyone would have a solution for that.