Attempt to loop a TextSize back and forth

Basically, I’m trying to replicate the splash screen on MC for my game; the yellow text if you don’t know what MC is

This is the script that I have come up with, yet it does nothing. I don’t really know too much on this side of guis so any help would be appreciated.

while wait(1) do
		for loop = 30,40 do
			wait(0.1)
			script.Parent.TextSize = loop/40
		end
end

Instead of using loops, lets try tweening!

script.Parent.TextSize = 30 -- This is the start Size
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, true, 0)
local tween = TweenService:Create(script.Parent, tweenInfo, {TextSize = 40}) -- This is the highest size
tween:Play()

This should fit your script fine!
You can also customize the speed of the animation, currently its set at 0.2 seconds.
Where you see the -1, thats the amount of times the tween is looped, any number below zero is infinite loops.
And the final number on the tween info is the delay time, this is how many seconds is waited until the tween is looped again.
You can also stop this tween by doing tween:Cancel()

2 Likes