Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ContentProvider = game:GetService("ContentProvider")
- local ReplicatedFirst = game:GetService("ReplicatedFirst")
- local Assets = game:GetDescendants()
- local Frame = script.Parent.Frame
- local function LoadingLoop()
- Frame.Visible = true
- for i = 1, #Assets do
- ContentProvider:PreloadAsync({Assets[i]})
- local Percentage = math.floor(i / #Assets * 100)
- Frame.ProgressFrame.Assets.Text = `Assets Loaded: {i} / {#Assets}`
- Frame.ProgressFrame.Progress:TweenSize(UDim2.fromScale(Percentage / 100, 1), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.1, true)
- end
- task.wait(1)
- Frame:TweenSizeAndPosition(UDim2.fromScale(0, 0), UDim2.fromScale(0.5, 1.5), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1)
- task.wait(1.5)
- Frame.Visible = false
- end
- LoadingLoop()
- ReplicatedFirst:RemoveDefaultLoadingScreen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement