So what I'm doing is that I'm doing an intro script and it basically stalls the time because the stuff in my game takes a while to load. However, it doesn't seem to work (time is way longer than expected, the number goes back) (take a look at the code to understand more) here is the code:
local loading = script.Parent.Frame.assets
local frame = script.Parent.Frame
local buttoon = frame.TextButton
local label = frame.TextLabel
frame.TextButton.MouseButton1Click:Connect(function(startup)
wait (math.random(2))
loading.Text = "Loading assets: 1 of 9"
wait (math.random(1,6))
loading.Text = "Loading assets: 2 of 9"
wait (math.random(1,6))
loading.Text = "Loading assets: 3 of 9"
wait (math.random(1,6))
loading.Text = "Loading assets: 4 of 9"
wait (math.random(1,6))
loading.Text = "Loading assets: 5 of 9"
wait (math.random(3,6))
loading.Text = "Loading assets: 6 of 9"
wait (math.random(1,6))
loading.Text = "Loading assets: 7 of 9"
wait (math.random(5,11))
loading.Text = "Loading assets: 9 of 9"
wait (math.random(5,11))
loading.Text = "Loading assets: 9 of 9"
wait(1)
loading.Text = "Loading Complete. Welcome."
wait (0.1)
frame.BackgroundTransparency=0.1
buttoon.BackgroundTransparency=0.1
loading.BackgroundTransparency=0.1
label.BackgroundTransparency=0.1
wait (0.1)
frame.BackgroundTransparency=0.2
buttoon.BackgroundTransparency=0.2
loading.BackgroundTransparency=0.2
label.BackgroundTransparency=0.2
wait (0.1)
frame.BackgroundTransparency=0.2
buttoon.BackgroundTransparency=0.2
loading.BackgroundTransparency=0.2
label.BackgroundTransparency=0.2
wait (0.1)
frame.BackgroundTransparency=0.3
buttoon.BackgroundTransparency=0.3
loading.BackgroundTransparency=0.3
label.BackgroundTransparency=0.3
wait (0.1)
frame.BackgroundTransparency=0.4
buttoon.BackgroundTransparency=0.4
loading.BackgroundTransparency=0.4
label.BackgroundTransparency=0.4
wait (0.1)
frame.BackgroundTransparency=0.5
buttoon.BackgroundTransparency=0.5
loading.BackgroundTransparency=0.5
label.BackgroundTransparency=0.5
wait (0.1)
frame.BackgroundTransparency=0.6
buttoon.BackgroundTransparency=0.6
loading.BackgroundTransparency=0.6
label.BackgroundTransparency=0.6
wait (0.1)
frame.BackgroundTransparency=0.7
buttoon.BackgroundTransparency=0.7
loading.BackgroundTransparency=0.7
label.BackgroundTransparency=0.7
wait (0.1)
frame.BackgroundTransparency=0.8
buttoon.BackgroundTransparency=0.8
loading.BackgroundTransparency=0.8
label.BackgroundTransparency=0.8
wait (0.1)
frame.BackgroundTransparency=0.9
buttoon.BackgroundTransparency=0.9
loading.BackgroundTransparency=0.9
label.BackgroundTransparency=0.9
wait (0.1)
frame.BackgroundTransparency=1
buttoon.BackgroundTransparency=1
loading.BackgroundTransparency=1
label.BackgroundTransparency=1
wait (1)
script.Parent.Frame.Visible=false
end)
like erm yeah and pls help

4 comments
You could use for loops,
Also if you want a "good" loading screen, use PreloadAsync (https://www.youtube.com/watch?v=1DvEdRTATW0)
bro??? this isn't a loading screen?? this is just making players wait for NO reason, roblox has their own loading screen. the solution to this is to just REMOVE IT
People like to make their own loading screen, because sometimes the Roblox loading screen loads too fast, causing things to be not loaded. People like to have a specific style of game, and the Roblox loading screen doesn't cut it