#Loading screen Script

51 messages · Page 1 of 1 (latest)

eager trenchBOT
#

studio** You are now Level 1! **studio

mint idol
#

click on this dot

slim flax
#

yes and ??

runic jetty
#

its a break point you need to remove it your script execution stops after reaching it

tight goblet
#

Right click on the red dot and click remove brake point or somthing like that

slim flax
#

It was not activated, just my mouse hovering over it

runic jetty
#

ight

#

please copy paste the script in here in this format:

slim flax
#

good ?

#
local replicatedFirst = game:GetService("ReplicatedFirst")
local contentProvider = game:GetService("ContentProvider")
local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")

local player = players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGUI")
local loadingScreen = script:WaitForChild("LoadingScreen")

replicatedFirst:RemoveDefaultLoadingScreen()

local assets = game:GetDescendants()

local clonedLoadingScreen = loadingScreen:Clone()
clonedLoadingScreen.Parent = playerGui

for i = 1, #assets do
    local asset = assets[i]
    local percentage = math.round(i / #assets * 100)
    
    contentProvider:PreloadAsync({asset})
    
    clonedLoadingScreen.Background.DisplayPourcentage.Text = percentage.."%"
    clonedLoadingScreen.Background.DisplayAssetsLoaded.Text = "Loading Assets: "..i.."/"..#assets
    
    if i % 5 == 0 then
        task.wait()
    end
    
    if i == #assets then
        task.wait(1)
    end    
end
runic jetty
#

yep ty

slim flax
#

I changed this line of code and the screen is displayed:

#

local playerGui = player:WaitForChild("PlayerGUI")

#

but the screen does not load...

runic jetty
#

yea

split temple
#

PlayerGui

runic jetty
#

gimme a second

split temple
#

no PlayerGUI

slim flax
runic jetty
#

wait

#
local replicatedFirst = game:GetService("ReplicatedFirst")
local contentProvider = game:GetService("ContentProvider")
local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")

local loadingScreen = script.Parent

replicatedFirst:RemoveDefaultLoadingScreen()

local assets = game:GetDescendants()

for i = 1, #assets do
    local asset = assets[i]
    local percentage = math.round(i / #assets * 100)
    
    contentProvider:PreloadAsync({asset})
    
    loadingScreen.TextLabel2.Text = percentage.."%"
    loadingScreen.TextLabel.Text = "Loading Assets: "..i.."/"..#assets
    
    if i % 5 == 0 then
        task.wait()
    end
    
    if i == #assets then
        task.wait(1)
    end    
end

Modify this code that it fits for you the cloning was completly unneccessery btw

#

@slim flax

night widget
#

print("BabyShark")
#

try this

runic jetty
#

why should he do this

#

my script is littary working 😭

slim flax
#

I must be cursed, when I put your script it doesn't work either... nothing is displayed anymore

eager trenchBOT
#

studio** You are now Level 2! **studio

runic jetty
#

thats because I have script.Parent as my loadingScreen you obviously need to change it 😭

night widget
#

wait

eager trenchBOT
#

studio** You are now Level 2! **studio

night widget
#

do

runic jetty
#
local replicatedFirst = game:GetService("ReplicatedFirst")
local contentProvider = game:GetService("ContentProvider")
local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")

local loadingScreen = script.Parent --Change this

replicatedFirst:RemoveDefaultLoadingScreen()

local assets = game:GetDescendants()

for i = 1, #assets do
    local asset = assets[i]
    local percentage = math.round(i / #assets * 100)
    
    contentProvider:PreloadAsync({asset})
    
    loadingScreen.TextLabel2.Text = percentage.."%" --Change This
    loadingScreen.TextLabel.Text = "Loading Assets: "..i.."/"..#assets --Change This
    
    if i % 5 == 0 then
        task.wait()
    end
    
    if i == #assets then
        task.wait(1)
    end    
end
night widget
#

who to do color nub ?

#

local textButton = script.Parent
local Main = script.Parent.Parent.Parent.Main
local informationsFrame = script.Parent.Parent.Parent.Main.Informations

local function onClick()
    for _, frame in pairs(Main:GetChildren()) do
        if frame:IsA("Frame") then
            frame.Visible = false
        end
    end

    informationsFrame.Visible = true
end

textButton.MouseButton1Click:Connect(onClick)

runic jetty
#

???

runic jetty
#

#1020374354867007528

night widget
#

it's a test

slim flax
#
local loadingScreen = script.Parent
#

Do I have to put a WaitForChild for this line? I understand more

runic jetty
#

no cause my script is in my screengui and how is the script supposed to load wehn its parent isnt loaded yet

slim flax
#

I'm sorry but it still doesn't show up..

green gust
#

also thats the worst way to use content provider service. i can optimise it

runic jetty
green gust
#

im terrible at explaining

runic jetty
#

then dont come here and tell him u can optimize his script if u dont wnat