How can I make a reverse typewriter effect?

Hello so im new to this typewriter effect using graphemes. Here is my code;

local Counter = 0
local CHARACTERS_PER_SECOND = 10
startingGui.TextLabel.Text = "The Rain Coat Man"
startingGui.TextLabel.MaxVisibleGraphemes = 0
local Counter = 0
local CHARACTERS_PER_SECOND = 10
for _, _ in utf8.graphemes("The Rain Coat Man") do
	Counter += 1
	startingGui.TextLabel.MaxVisibleGraphemes = Counter
	wait(1 / CHARACTERS_PER_SECOND)
end

I want to try to make it instead of typing the letters make like an effect where it backspaces or deletes the letters one by one using the grapheme method.

iā€™m not 100% sure but maybe if you change the + to a - here
Counter += 1 to Counter -= 0

local Counter = 0
local CHARACTERS_PER_SECOND = -10
startingGui.TextLabel.Text = "The Rain Coat Man"
startingGui.TextLabel.MaxVisibleGraphemes = 0
local Counter = 1
local CHARACTERS_PER_SECOND = 10
for _, _ in utf8.graphemes("The Rain Coat Man") do
	Counter -= 0
	startingGui.TextLabel.MaxVisibleGraphemes = Counter
	wait(1 / CHARACTERS_PER_SECOND)
end

This is what I tried first but it seemed to just set the text to blank.

maybe try now, and if it dont work try to change / to * in
wait(1 / CHARACTERS_PER_SECOND)

Try this:

local CHARACTERS_PER_SECOND = 10
local TEXT = "The Rain Coat Man"

startingGui.TextLabel.Text = TEXT

local Counter = 0
for _, _ in utf8.graphemes(TEXT) do
    Counter += 1
end

startingGui.TextLabel.MaxVisibleGraphemes = Counter

for _, _ in utf8.graphemes(TEXT) do
	Counter -= 1
	startingGui.TextLabel.MaxVisibleGraphemes = Counter
	wait(1 / CHARACTERS_PER_SECOND)
end

This unfortunately did not work.

This worked thank you I found out the error.

1 Like