Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TS = game:GetService("TweenService")
- local CP = game:GetService("ContentProvider")
- local preloadObjects = workspace:WaitForChild("PreloadObjects")
- local mainFrame = script.Parent:WaitForChild("MainFrame")
- local loadFrame = mainFrame:WaitForChild("LoadFrame")
- local bar = loadFrame:WaitForChild("Bar")
- local progressLabel = bar:WaitForChild("ProgressLabel")
- for i = 1, #preloadObjects:GetDescendants() do
- CP:PreloadAsync({preloadObjects:GetDescendants()[i]})
- bar.Size = UDim2.new(i / #preloadObjects:GetDescendants(), 0, 1, 0)
- progressLabel.Text = math.floor(i / #preloadObjects:GetDescendants() * 100) .. "%"
- end
- local tween = TS:Create(mainFrame, TweenInfo.new(.75), {GroupTransparency = 1})
- tween:Play()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement