#Loading screen errors
6 messages · Page 1 of 1 (latest)
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.DisplayPercentage.Text = percentage.."%"
clonedLoadingScreen.Background.DisplayAssetsLoaded.Text = "Loading Assets: "..i.."/"..#assets
tweenService:Create(clonedLoadingScreen.Background.Bar.Size, TweenInfo.new(0.2,Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Size = UDim2.fromScale(percentage/100, 1)}):Play()
if i % 5 == 0 then
task.wait()
end
if i == #assets then
task.wait(1)
end
end```
heres the script
its not finished yet it still needs to have loading screen closing script added but this should be working, the loading screen should be appearing but it doesnt