Tips not working?

I have a tips script for a loading screen. It doesn’t work though, I don’t know why.
Please call me out if I made a mistake, thank you!

SCRIPT (NOT MINE):

local tips = {"Brush your teeth buckoo!", 
	"Eat your vegetables!",
	"Best sleep early for a good night's rest.",
	"Love those who love you :)",
	"Did you know that I am inside your home?",
	"Listen to the walls.",
	"The floor is breathing.",
	"Did you lock your door yet?"}

local function tweentxt(obj, val)
	local tween = tweenserice:Create(obj, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut, 0, false, 0), {TextTransparency = val}):Play()
end

for i = 1, #Assets do -- from index 1 to the last asset number, it does
	local asset = Assets[i] -- here is to get the current asset loading

	ContentProvider:PreloadAsync({asset}) -- load the asset into the game
	text1.Text = ""..i.."/"..#Assets.."" -- show his name and the current progress

	if not game:IsLoaded() then
		repeat
			tweentxt(text3, 0)
			text3.Text = "~ "..tips[math.random(1,#tips)].." ~"
			tweentxt(text3, 1)
		until game:IsLoaded()
	end
end

You should move this block of code to the top of the loop as a coroutine so that it runs while the assets are loading. The way you’ve structured the code right now is that it will show a single tip and do nothing else until the entire game has loaded

task.spawn(function()
	if not game:IsLoaded() then
		repeat
			tweentxt(text3, 0)
			text3.Text = "~ "..tips[math.random(1,#tips)].." ~"
			tweentxt(text3, 1)
		until game:IsLoaded()
	end
end)

for i = 1, #Assets do -- from index 1 to the last asset number, it does
	local asset = Assets[i] -- here is to get the current asset loading

	ContentProvider:PreloadAsync({asset}) -- load the asset into the game
	text1.Text = ""..i.."/"..#Assets.."" -- show his name and the current progress
end