Checking loading percentage

So i’ve created a loading screen and it works fine but now i want to add animation, and a thing that says the percentage of game loaded , basicly i need to check the amount of percentage and display it on the loading screen, and also the bar i would use a tweensize so it gets bigger wich the 0.5 would be the 100% so its finished but i want it to say the real amount of % loaded and the bar size would match that
How can i do it?

The best way of achieving what you want is by using the ContentProvider service and preloading assets into the game. I have an example script below or you can look at the whole thing in the place below.

local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)

local ContentProvider = game:GetService("ContentProvider")

script.Parent.Parent.Parent.Enabled = true

local percent = 0
local loadables = workspace:GetChildren()

local function round(n)
	return math.floor(n + 0.5)
end

table.insert(loadables, 1, script.Parent.Parent.Parent.Parent:GetChildren())

wait(1)

local amount_loaded = 0

for i = 1, #loadables do
	ContentProvider:PreloadAsync({loadables[i]})
	amount_loaded = i
	percent = round(((i / #loadables) * 100))
	script.Parent.Text = "Loading: " .. percent .. "%"
	script.Parent.Parent.LoadingBarOuter.LoadingBarInner.LoadingBar:TweenSize(
		UDim2.new(amount_loaded/#loadables,0,0,24),
		Enum.EasingDirection.InOut,
		Enum.EasingStyle.Linear,
		0.1
	)
	if percent > 25 then
		script.Parent.Parent.Parent.SkipFrame.Visible = true
	end
	if amount_loaded == #loadables then
		script.Parent.Parent.LoadingBarOuter.LoadingBarInner.LoadingBar:TweenSize(
			UDim2.new(1,0,0,24),
			Enum.EasingDirection.InOut,
			Enum.EasingStyle.Linear,
			0.1
		)
	end
end

debounce = true
wait()
script.Parent.Text = "Loading... Finalising..."
wait(2)


script.Parent.Parent:TweenPosition(UDim2.new(1,0,0,0), "Out", "Bounce", 1.5)
wait(1.6)
script.Parent.Parent.Parent:Destroy()
1 Like

i have something similar but it doesnt says the amount of % loaded

i have this:
local Players = game:GetService(“Players”)

local ReplicatedFirst = game:GetService(“ReplicatedFirst”)

local player = Players.LocalPlayer

local playerGui = player:WaitForChild(“PlayerGui”)

local screenGui = ReplicatedFirst:FindFirstChild(“LoadingScreen”)

screenGui.IgnoreGuiInset = true

screenGui.Parent = playerGui

ReplicatedFirst:RemoveDefaultLoadingScreen()

wait(5)

if not game:IsLoaded() then

game.Loaded:Wait()

end

screenGui:Destroy()

now gotta calculate %
btw ur script didnt work gave me error