Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

is there anyway to make letter delay in typeout?

Asked by 4 years ago
Edited 4 years ago

i want text to type out but if its for example "." there will be a delay before it like in soulshatters test place

local text = "test..."
        for i = 1, #text do
            game.Players.LocalPlayer.PlayerGui.Dialogue.DialogueBackground.Text.Text = string.sub(text, 3, i)
            script.Voice:Play()
                wait(0.025)
            end
0
Use wait() bomblitz06 94 — 4y
0
that doesnt answer my question, my question is how to make it to give a delay for specifically symbols such as comma or dot, but letters appear with delay of 0.0025 arsen0839 -8 — 4y
0
if text[i] == "." then wait(1) end greatneil80 2647 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

Check if the character is a symbol, then if it is, give it a longer delay than letters

local text = "test..."
local currentChar = "placeholder"
        for i = 1, #text do
        currentChar = string.sub(text, i, i)
            game.Players.LocalPlayer.PlayerGui.Dialogue.DialogueBackground.Text.Text = string.sub(text, 3, i)
            script.Voice:Play()
        if string.match(currentChar, "%p") ~= nil then -- %p represents all punctuation and symbols
        wait(1) -- or however long you want
        else
                wait(0.025)
        end
            end

For more on lua patterns

0
yeah that obviously answered my question arsen0839 -8 — 4y
0
how am i able to edit it so it only gives delay to symbols i want? arsen0839 -8 — 4y
0
go to the link on the answer bomblitz06 94 — 4y
0
found out, instead of "%p" just had to put "[insert symbols you want it to search]" arsen0839 -8 — 4y
Ad

Answer this question