Good evening,
I'm having some trouble here with an intro gui I'm working with and I want the texts to randomly be selected as loading procedures for the loading part of the intro GUI. For some reason it has all of the text filled at the same time and doesn't do anything more. I have below the script that I made and here is the set up:
text 2 (frame) ->MainTL (TextLabel) -->script -->tl1 -->tl2 -->tl3 -->tl4 -->tl5
local mtl = script.Parent.Parent.MainTL
local tl1 = script.Parent.tl1
local tl2 = script.Parent.tl2
local tl3 = script.Parent.tl3
local tl4 = script.Parent.tl4
local tl5 = script.Parent.tl5
while true do
wait()
math.random(1, 5)
if math.random == 1 then
wait(0.2)
mtl.Text = tl1.Text.. "."
wait(0.2)
mtl.Text = tl1.Text.. ".."
wait(0.2)
mtl.Text = tl1.Text.. "..."
wait(0.2)
mtl.Text = tl1.Text.. "."
mtl.Text = tl1.Text.. ".."
wait(0.2)
mtl.Text = tl1.Text.. "..."
wait(0.2)
end
if math.random == 2 then
wait(0.2)
mtl.Text = tl2.Text.. "."
wait(0.2)
mtl.Text = tl2.Text.. ".."
wait(0.2)
mtl.Text = tl2.Text.. "..."
wait(0.2)
mtl.Text = tl2.Text.. "."
mtl.Text = tl2.Text.. ".."
wait(0.2)
mtl.Text = tl2.Text.. "..."
wait(0.2)
end
if math.random == 3 then
wait(0.2)
mtl.Text = tl3.Text.. "."
wait(0.2)
mtl.Text = tl3.Text.. ".."
wait(0.2)
mtl.Text = tl3.Text.. "..."
wait(0.2)
mtl.Text = tl3.Text.. "."
mtl.Text = tl3.Text.. ".."
wait(0.2)
mtl.Text = tl3.Text.. "..."
wait(0.2)
end
if math.random == 4 then
wait(0.2)
mtl.Text = tl4.Text.. "."
wait(0.2)
mtl.Text = tl4.Text.. ".."
wait(0.2)
mtl.Text = tl4.Text.. "..."
wait(0.2)
mtl.Text = tl4.Text.. "."
mtl.Text = tl4.Text.. ".."
wait(0.2)
mtl.Text = tl4.Text.. "..."
wait(0.2)
end
if math.random == 5 then
wait(0.2)
mtl.Text = tl5.Text.. "."
wait(0.2)
mtl.Text = tl5.Text.. ".."
wait(0.2)
mtl.Text = tl5.Text.. "..."
wait(0.2)
mtl.Text = tl5.Text.. "."
mtl.Text = tl5.Text.. ".."
wait(0.2)
mtl.Text = tl5.Text.. "..."
wait(0.2)
end
end

2 comments
why is it so hard to put it in for loops?
This method would work better if you use elseif instead of if each time, but I would recommend switching to a loop to make things more efficient.