Help w/ textlabel tables

Script:

	local message = "Oh, the mortal I've been hearing about!"
	local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
	for i = 1, #message do
		TextLabel.Text = string.sub(message, 1, i)
		script.Parent.merp:Play()
		wait(3)
		local message = "Ooohoohooo!"
		local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
		for i = 1, #message do
			script.Parent.merp:Play()
			TextLabel.Text = string.sub(message, 1, i)
	
			wait(3)
			local message = "So you've managed to crawl into my lair, hm?"
			local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
			for i = 1, #message do
				wait(2)
				script.Parent.merp:Play()
				TextLabel.Text = string.sub(message, 1, i)
				end

and so on, but that isn’t important.
I was told to use this table instead of using every seperate letter.
Problem: This is very inefficient, and sends one letter every ~5 seconds.
Also, sometimes switches to the other textlabels for some reason. Lil’ help here?
Also: does not continue the message after letter 1.

1 Like

What are you trying to do then?

Make the character in question send the entire message letter by letter, like a typewriting effect, every letter per 0.5 seconds.
“merp” sound plays for every letter sent

And by “letter by letter”, I don’t mean changing the texltabel to random letters. I mean putting the letter togethers like “h” “he” “hel” “hell” “hello” to make a sentence.

do you want it to be sentence after sentence or a random sentence each time?

sentence after sentence

robloxapp-20230624-2002505.wmv (341.3 KB)
so like this?

Yeah, but every 0.5 seconds

Wdym? Each letter every .5 seconds?

Yup

local textlabel = script.Parent

local function writetext(object,text,length)
	for i = 1, #text do
		object.Text = string.sub(text,1,i)
		wait(length)
	end
end


writetext(textlabel,"HELLO",0.5)
1 Like

This is gonna be painful to rewrite. Is there any way to make it so I don’t have to rewrite too much? Sorry.

If not, I’ll do it though.

you want it to auto do it for you?

Yeah. Would love to, cause take a look at this:

	local message = "Oh, the mortal I've been hearing about!"
	local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
	for i = 1, #message do
		TextLabel.Text = string.sub(message, 1, i)
		script.Parent.merp:Play()
		wait(3)
		local message = "Ooohoohooo!"
		local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
		for i = 1, #message do
			script.Parent.merp:Play()
			TextLabel.Text = string.sub(message, 1, i)
	
			wait(3)
			local message = "So you've managed to crawl into my lair, hm?"
			local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
			for i = 1, #message do
				wait(2)
				script.Parent.merp:Play()
				TextLabel.Text = string.sub(message, 1, i)
				 
				wait(2)
				local message = "How deeelightful!"
				local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
				for i = 1, #message do
					script.Parent.merp:Play()
				TextLabel.Text = string.sub(message, 1, i)
				 
					wait(2)
					local message = "But know this, foolish mortal:"
					local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
					for i = 1, #message do
				TextLabel.Text = string.sub(message, 1, i)
				script.Parent.merp:Play()
				script.Parent.EGTheme:Play()
				 
				local message = "your journey  s here, in the realm of eternal darkness."
				local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
				for i = 1, #message do
					TextLabel.Text = string.sub(message, 1, i)
				script.Parent.merp:Play()
			 
			wait(2)
			local message = "How amusing it is to watch you struggle and suffer."
			local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
			for i = 1, #message do
				TextLabel.Text = string.sub(message, 1, i)
				script.Parent.merp:Play()
			 
			local message = "Your pitiful attempts to challenge me have only led you to your own demise."
			local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
			for i = 1, #message do
				TextLabel.Text = string.sub(message, 1, i)
				script.Parent.merp:Play()
				wait(4)
				local message = "Your pitiful attempts to challenge me have only led you to your own demise."
				local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
				for i = 1, #message do
					TextLabel.Text = string.sub(message, 1, i)
					script.Parent.merp:Play()
					wait(4)
					local message = "The time has come, insolent fool.."
					local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
					for i = 1, #message do
						TextLabel.Text = string.sub(message, 1, i)
						script.Parent.merp:Play()
						wait(2)
						local message = "Prepare yourself, for you are about to face the culmination of my wickedness."
						local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
						for i = 1, #message do
							TextLabel.Text = string.sub(message, 1, i)
							script.Parent.merp:Play()
							wait(6)
							local message = " This is not a battle for victory or redemption,"
							local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
							for i = 1, #message do
								TextLabel.Text = string.sub(message, 1, i)
								script.Parent.merp:Play()
								wait(5)
								local message = "but a cataclysmic clash that shall shatter your very existence. "
								local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
								for i = 1, #message do
									TextLabel.Text = string.sub(message, 1, i)
									script.Parent.merp:Play()
									wait(4)
									local message = "Your feeble attempts will be consumed by darkness, your soul seared by damnation."
									local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
									for i = 1, #message do
										TextLabel.Text = string.sub(message, 1, i)
										script.Parent.merp:Play()
										wait(8)
										local message = "There is no mercy here, for I am the embodiment of malevolence. "
										local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
										for i = 1, #message do
											TextLabel.Text = string.sub(message, 1, i)
											script.Parent.merp:Play()
											wait(6)
											local message = " The final boss fight awaits, and your ultimate demise looms. "
											local TextLabel = script.Parent.BillboardGui.MainFrame.Dialogue1
											for i = 1, #message do
												TextLabel.Text = string.sub(message, 1, i)
												script.Parent.merp:Play()
												wait(4)
												script.Parent.BillboardGui.MainFrame.Visible = false
												wait(2)
												local newPos2 = part.Position + Vector3.new(0, -5 ,0)
												tween2:Play()

I am not rewriting all of that, unless I really have to lol

This is designed for spawning into the game but should work with a few changes.

while true do
	for i = 1, #msgs do
		spawn(function()
			while script.Parent.TextTransparency >= 0 and wait() do
				script.Parent.TextTransparency = script.Parent.TextTransparency - 0.1
			end
		end)
		for j = 1, #msgs[i] do
			script.Parent.Text = string.sub(msgs[i], 1, j)
			wait()
		end
		wait(10)
		while script.Parent.TextTransparency <= 1 and wait() do
			script.Parent.TextTransparency = script.Parent.TextTransparency + 0.1
		end
	end
end

Would quite enjoy if you could project these changes into text

I’m not a scripter at all, I won’t know what to change

Well the video’s there. So any experienced coders should be able to use that and provide a working script for you,