How to slowdown typewriter code with punctuations?

I’m trying to slowdown my typewriting code (For a dialogue GUI) when the string starts to input punctuation marks so that it won’t be constant

i tried this code:


local function typewrite (object , text)
	for i = 1,#text,1 do
		if text:sub(i) == "%p" then
			object.Text = string.sub (text,1,i)
			wait(1)
			
		else
			object.Text = string.sub (text,1,i)
			wait(0.025)
		end
	end
end
1 Like
local function typewrite (object , text)
	for i = 1,#text,1 do
		if text:sub(i, i):match("%p") then
			object.Text = string.sub (text,1,i)
			wait(1)
		else
			object.Text = string.sub (text,1,i)
			wait(0.025)
		end
	end
end

(string.match)

2 Likes

thnx alot! i’ve been stuck with this for maybe 10 mins now!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.