--local script inside ReplicatedFirst
local cp = game:GetService("ContentProvider")
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
gui:SetTopbarTransparency(0)
local screen = Instance.new("ScreenGui")
screen.Parent = gui
local label = Instance.new("TextLabel")
label.Parent = screen
label.Text = "Please wait"
label.Size = UDim2.new(1,0,1,0)
label.Font = Enum.Font.SourceSans
label.FontSize = Enum.FontSize.Size24
label.BackgroundColor3 = Color3.new(222/255, 222/255, 222/255)
label.Active = true
script.Parent:RemoveDefaultLoadingScreen()
local count = 0
local start = tick()
local assets = {
259811967,
259812063,
259812109,
259812109,
259793973,
259812182,
259812211,
259794435,
259794453,
259794475,
259794484,
259794500,
259794517,
254637171,
254643239,
254643676,
}
for i, v in next, assets do
cp:Preload("rbxassetid://" ..v)
end
local largest = 0
local size = cp.RequestQueueSize
while wait(0.05) and cp.RequestQueueSize > 0 do
local current = math.floor(((1-cp.RequestQueueSize/size)*100)+0.5)/100*100
if current > largest then
label.Text = string.rep(".",count).."Loading Assets: "..current.."%"..string.rep(".",count)
count = (count + 1) % 4
largest = current
end
end
if cp.RequestQueueSize == 0 then
count = 0
for i = 7,0,-1 do
label.Text = string.rep(".",count).." Waiting for the game "..string.rep(".",count)
count = (count + 1) % 4
wait(0.5)
end
label.Text = "Finished!"
wait(1)
for i = 0,1,0.01 do
label.BackgroundTransparency = i
label.TextTransparency = i
wait(0.01)
end
screen:Destroy()
end |