I made a loading screen but the percent bar and the percent text is not changing. ```
local MainScreenGui = script.Parent
local MainFrame = MainScreenGui.MainLoadingScreen -- Change names accordingly.
local TweenService = game:GetService("TweenService")
local Text = MainFrame.ProgressText
local MovingBar = MainFrame.BackgroundBar.MovingBar -- Change names accordingly.
MovingBar.Size = UDim2.new(0, 0, 1, 0)
local MainMenu = script.Parent.Parent.ScreenGui.Frame -- Main Menu Screen
for percentage = 1, 100 do
wait(0.1) -- The lower the number the faster the bar moves.
Text.Text = percentage .. "%"
Text.Text = percentage .. "%"
local Progress = percentage / 100
MovingBar:TweenSize(UDim2.new(Progress, 0, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.1, true)
if percentage == 100 then
local FadeInTween = TweenService:Create(MainScreenGui.Fade, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {BackgroundTransparency = 0})
FadeInTween:Play()
FadeInTween.Completed:Wait()
wait(0.5)
MainFrame.Visible = false
MainMenu.Visible = true
local FadeOutTween = TweenService:Create(MainScreenGui.Fade, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {BackgroundTransparency = 1})
FadeOutTween:Play()
FadeOutTween.Completed:Wait()
end
end```