Advertisement
Cakey3101

Loading Screen Manager

Apr 28th, 2025
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | Source Code | 0 0
  1. local ContentProvider = game:GetService("ContentProvider")
  2. local ReplicatedFirst = game:GetService("ReplicatedFirst")
  3.  
  4. local Assets = game:GetDescendants()
  5.  
  6. local Frame = script.Parent.Frame
  7.  
  8. local function LoadingLoop()
  9.     Frame.Visible = true
  10.    
  11.     for i = 1, #Assets do
  12.         ContentProvider:PreloadAsync({Assets[i]})
  13.        
  14.         local Percentage = math.floor(i / #Assets * 100)
  15.        
  16.         Frame.ProgressFrame.Assets.Text = `Assets Loaded: {i} / {#Assets}`
  17.        
  18.         Frame.ProgressFrame.Progress:TweenSize(UDim2.fromScale(Percentage / 100, 1), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 0.1, true)
  19.     end
  20.    
  21.     task.wait(1)
  22.    
  23.    
  24.     Frame:TweenSizeAndPosition(UDim2.fromScale(0, 0), UDim2.fromScale(0.5, 1.5), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1)
  25.     task.wait(1.5)
  26.     Frame.Visible = false
  27. end
  28.  
  29. LoadingLoop()
  30.  
  31. ReplicatedFirst:RemoveDefaultLoadingScreen()
Tags: robloxstudio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement