Make Custom Loading Screen With Percentage

  1. What do you want to achieve?
    so i want to make a custom loading screen with percentage that loaded .
  2. What is the issue?
    i have the percentage already but i dont know how to shorten it .
--//Remove default loading bar
script.Parent:RemoveDefaultLoadingScreen()

--//New UI
local loadingScreen = script.ScreenGui
loadingScreen.Parent = game.Players.LocalPlayer.PlayerGui

local loadingBlur = script.LoadingBlur
loadingBlur.Parent = game.Lighting

--//Loading
local contenProvider = game:GetService("ContentProvider")
game.Loaded:Wait()
local toLoad = game:GetDescendants()
local total = #toLoad
for i,v in pairs(toLoad) do
	loadingScreen.Background.Counter.Text = "DOWNLOADED: "..i.." / ".."TOTAL: "..total
	loadingScreen.Background.BarBG.Bar.Size = UDim2.new(i/total, 0, 1, 0)
	contenProvider:PreloadAsync({v})
	
	print(i/total)
end

--//Finished loading
wait(1)
loadingBlur:Destroy()
loadingScreen:Destroy()

here is a picture of the percentage im talking about .

Captureessets

im planning to remove the front and the back so it will be 99.91% .So how do i do that ??

math.ceil()
math.floor()
i hope i helped

can you give a example on how to use it ??

math.round((i/total)*1000)/10

Here, this will make the percentages xx.x% only.

3 Likes

this works really well !! Thanks for the scripts .