Hi, someone knows how could i do this typewriter wait for custom signs?, Based on a table
function Module.Typewrite(TextLabel: TextLabel, Text: string, DelayBetweenChars)
local DisplayText = Text
DisplayText = DisplayText:gsub("<br%s*/>", "\n")
DisplayText:gsub("<[^<>]->", "")
TextLabel.MaxVisibleGraphemes = 0
TextLabel.Text = DisplayText
local Index = 0
if _G.CurrentCoroutine then
coroutine.close(_G.CurrentCoroutine)
_G.CurrentCoroutine = nil
end
task.wait()
local punctuations = {
[","] = 1
}
_G.CurrentCoroutine = coroutine.create(function()
for First, Last in utf8.graphemes(DisplayText) do
Index = Index + 1
warn(Index, First, Last)
TextLabel.MaxVisibleGraphemes = Index
task.wait(DelayBetweenChars) -- or the signs, but i need a way to find or know the text index using MaxGraphmes
end
warn("Finished")
end)
if _G.CurrentCoroutine then
coroutine.resume(_G.CurrentCoroutine)
end
end