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

[SOLVED] Will My Loading GUI Still Work With Preloading Errors?

Asked by 4 years ago
Edited 4 years ago

So, I have created a Loading GUI that uses ContentProvider and it gives me these errors when I run the code.

https://gyazo.com/f1491c00c2f1c31ca45161a64e7b4b3a

And this is my code

local ContentProvider = game:GetService("ContentProvider")
local Bar = script.Parent.Parent.Underlayer.Overlayer
local assets = {
    "Workspace",
    "StarterGui",
    "Lighting",
    "Players",
    "ReplicatedFirst",
    "ReplicatedStorage",
    "ServerScriptService",
    "ServerStorage",
    "StarterPack",
    "StarterPlayer",
    "Teams",
    "SoundService",
    "Chat",
    "LocalizationService"
}

wait(1)

script.Parent.Parent:TweenSize(UDim2.new(1,0,1,0),"Out","Quad",1,true)

wait(1.25)

for i = 1,#assets do
    local assetToLoad = assets[i]
    ContentProvider:PreloadAsync({assetToLoad})
    local newX =  i / #assets
    Bar:TweenSize(UDim2.new(newX,0,1,0),"Out","Quad",1,true)
    script.Parent.Text = "Loading Assets: "..math.floor (i / #assets * 100).."%"
end

wait(1.25)

wait(0.5)

script.Parent.Parent:TweenSize(UDim2.new(0,0,1,0),"Out","Quad",1,true)

wait(1.25)

script.Parent.Parent.Parent.CamScript.Disabled = true

local currentCam = game:GetService("Workspace").CurrentCamera
local camPart = game:GetService("Workspace"):WaitForChild("RotationModelCam").CamPart
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local blur = currentCam.Blur
local starterGui = game:GetService("StarterGui")
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
starterGui:SetCore("TopbarEnabled",true)
starterGui:SetCore("ResetButtonCallback",true)

for i = 12,1,-1 do
    wait()
    blur.Size = i
end

repeat wait()
    currentCam.CameraType = Enum.CameraType.Custom
until currentCam.CameraType == Enum.CameraType.Custom

This is what the setup is

https://gyazo.com/d9a8b28e126bfd3c9dc0035df6f318ff

This is how it looks.

https://gyazo.com/189a64acec5a930a5809b58a69a1c8b0

I'm just wondering, is the game actually still preloading with these errors that occur?

0
instead of using strings for the services, use game:GetService(). bluzorro 417 — 4y
0
Thanks, it fixed the errors. killerbrenden 1537 — 4y

Answer this question