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
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