How would I make an efficient typewriter effect?

Hi, I’m making a tutorial for my game and I’m using a simple typewriter effect. But I’ve been finding it tedious to copy and paste the function and then change the text in the text label, is there a more efficient way to do this?

1 Like

Not sure what you mean by copy pasting, but you can use this typewriter:

1 Like
-- You can edit the Text Variables if you want to.
local TextLine1 = "EDIT TEXT HERE 1"
local TextLine2 = "EDIT TEXT HERE 2"
local TextLine3 = "EDIT TEXT HERE 3"
local TextLine4 = "EDIT TEXT HERE 4"
local TextLine5 = "EDIT TEXT HERE 5"

local IntervalTime = 2

while wait(IntervalTime) do
	
	for T = 1, #TextLine1 do
		script.Parent.Text = string.sub(TextLine1, 1, T)
		wait(0.1)
	end		
	
	wait(IntervalTime)
	
	for T = 1, #TextLine2 do
		script.Parent.Text = string.sub(TextLine2, 1, T)
		wait(0.1)
	end		
	
	wait(IntervalTime)
	
	for T = 1, #TextLine3 do
		script.Parent.Text = string.sub(TextLine3, 1, T)
		wait(0.1)
	end		
	
	wait(IntervalTime)		
	
	for T = 1, #TextLine4 do
		script.Parent.Text = string.sub(TextLine4, 1, T)
		wait(0.1)
	end	
	
	wait(IntervalTime)
	
	for T = 1, #TextLine5 do
		script.Parent.Text = string.sub(TextLine5, 1, T)
		wait(0.1)
	end			
	
end

Yep, however for a more advanced version which takes into account lag and fps changes, the delta time version.

8 Likes

Thanks, but the bug still shows up when you search anything.
Screen Shot 2022-10-08 at 2.53.51 PM

It just endlessly loads then shows no results.

I don’t think this has any relation to the topic but try reloading roblox studio or reinstall it, that should fix your problem. Also check your wifi

I might have accidentally sent that before