How to make a loading typewriter effect

This is a pretty simple question and I know it has been asked a lot of times, but I just couldn’t find the perfect solution. So how can I make a loading typewriter effect like this:
giphy

Thanks in advance!

local text = "loading"
while true do
	wait()
	for i = 1,3 do
		print(text..string.rep(".",i))
		wait(.1)
	end
end

That’s just an example

2 Likes