Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I fix this script for typewriter effect?

This script is in my textlabel

local text = “G/“
Wait(0.05)
Local text = “Ga/“
Wait(0.05)
Local text = “Gam/“
Wait(0.05)
Local text = “Gam”
Wait(0.2)
Local text = “Gam/“
Wait(0.05)
Local text = “Game/“
Wait(0.05)
Local text = “Games/“

1 answer

✓ Accepted answer

First of all you didn’t identify what text you’re changing. Assuming your script is in the textlabel, to reach the label we would do

local label = script.Parent

Then we would have to change the text

label.Text = "G/"

We then would continue this effect. Full script:

local label = script.Parent
label.Text = "G/"
wait(0.05)
label.Text = "Ga/"
wait(0.05)
label.Text = "Gam/"
wait(0.05)
label.Text = "Gam"
wait(0.2)
label.Text = "Gam/"
wait(0.05)
label.Text = "Game/"
wait(0.05)
label.Text = "Games/"
wait(0.05)

If you want a way to do this using less code, then just do this:

local TextLabel = script.Parent

local message = "Games/"

for letter = 1,#message do wait(.1)
   TextLabel.Text = TypeWriteString:sub(1,letter) -- This makes it so it waits 0.1 seconds and adds a letter until the whole message is there
end

This discussion is preserved as it was. New answers, comments, and votes are closed.