ok, so ive made a actual loading screen with content provider and other services and also some other things, when I made it the loading was working perfectly fine, then after like 2 days it just stopped working, whats the problem?
local ReplicatedFirst = game:GetService("ReplicatedFirst")
ReplicatedFirst:RemoveDefaultLoadingScreen()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ContentProvider = game:GetService("ContentProvider")
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local remoteEvent = ReplicatedStorage:WaitForChild("RemoteEvents"):WaitForChild("PlayerAccess2")
local player = Players.LocalPlayer
local ignoredTypes = {
["Script"] = true,
["LocalScript"] = true,
["ModuleScript"] = true
}
local Main = script.Parent:WaitForChild("Background")
local LoadingText = Main:FindFirstChild("LoadingText")
local EpicFace = Main:FindFirstChild("EpicFace")
local Title = Main:FindFirstChild("Title")
local SkipButton = Main:FindFirstChild("Skip")
local UpdateLog = script.Parent.Parent:FindFirstChild("UpdateLog")
local Skip = Main:FindFirstChild("Skip")
local Sprint = Main.Parent.Parent:FindFirstChild("Sprint")
local spawnPosition = Vector3.new(-820.6, 137.913, 1828.26)
local fadeOutTween = TweenInfo.new(0.8, Enum.EasingStyle.Quint)
local function fadeAway()
TweenService:Create(Main, fadeOutTween, {BackgroundTransparency = 1}):Play()
for _, ui in ipairs(Main:GetChildren()) do
if ui:IsA("Frame") or ui:IsA("TextLabel") then
TweenService:Create(ui, fadeOutTween, {BackgroundTransparency = 1, TextTransparency = 1}):Play()
elseif ui:IsA("ImageLabel") then
TweenService:Create(ui, fadeOutTween, {ImageTransparency = 1}):Play()
end
end
end
local function isGuiEnabled()
return Main.Visible
end
if isGuiEnabled() then
Sprint.Enabled = false
else
Sprint.Enabled = true
end
local function anchorCharacter(state)
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:FindFirstChild("HumanoidRootPart") or character:WaitForChild("HumanoidRootPart", 5)
if hrp then
hrp.Anchored = state
if state then
hrp.CFrame = CFrame.new(spawnPosition)
end
end
end
anchorCharacter(true)
local fpsValues = {260, 248, 236, 287, 294, 210, 298}
local function getFPS()
return fpsValues[math.random(1, #fpsValues)]
end
local function getLoadSpeed()
return 1 / (getFPS() / 60)
end
local assets = {}
for _, asset in ipairs(game:GetDescendants()) do
if not ignoredTypes[asset.ClassName] then
table.insert(assets, asset)
end
end
local startTime = tick()
local batchSize = getFPS()
if isGuiEnabled() then
for i = 1, #assets, batchSize do
local batch = {}
for j = i, math.min(i + batchSize - 1, #assets) do
table.insert(batch, assets[j])
end
ContentProvider:PreloadAsync(batch)
if LoadingText then
LoadingText.Text = "Loading Assets (" .. math.min(i + batchSize - 1, #assets) .. "/" .. #assets .. ")"
end
if tick() - startTime >= 30 and Skip then
Skip.Visible = true
fadeAway()
remoteEvent:FireServer()
break
end
task.wait(getLoadSpeed() * 0.5)
end
task.wait(0.5)
fadeAway()
if UpdateLog then
UpdateLog.vis.Visible = false
end
if remoteEvent then
remoteEvent:FireServer()
if UpdateLog then
UpdateLog.vis.Visible = true
end
end
task.wait(fadeOutTween.Time + 0.2)
anchorCharacter(false)
Sprint.Enabled = true
end