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

A TypeWriter-like script?

I'm creating a game, and I'm having a hard time solving this Problem, How do I make a Typewriter-like script, for Instance:

I want to make a Text that says Watcha Doing

and it appears-up like this:

  • W

  • Wa

  • Wat

  • Watc

etc. I'm not requesting just a little example.

4 answers

✓ Accepted answer

Do what dragonkeeper was doing except use my script since it will be shorter.


Inside the text label thing:

local text = "Watcha Doing"
for i = 1, text:len() do
	wait(.1) --You can change this to wait() if you want to make it type REALLY fast.
	script.Parent.Text = text:sub(0, i)
end

1 comment

1

lol true, you managed to get even shorter than me :P

Determine the string length, then use a for loop to add each letter on and stagger it.

local string = "hello"
local stringlength = string.len(string)

for i = 1, #stringlength do
game.Players.LocalPlayer.PlayerGui.typewriter.Text = string.sub(string, (stringlength - i))
i = i + 1
wait(1) -- how long you wait for each letter to appear
end

2 comments

0

Your script is also inefficient. You shouldn't be talking.

0

Your script won't work anyway, dragon. You have a # before stringlength and you're adding 1 to i all the time, so it will skip every other letter and will cause errors.

I'm not allowed to give you the script but I can give you some hints

You will need functions http://wiki.roblox.com/index.php/Function

Remember to use PlayerGui to edit the text not StarterGui http://wiki.roblox.com/index.php?title=API:Class/PlayerGui

For having the text "TypeWrite" use wait() in the code

game.Players.LocalPlayer.PlayerGui.typewriter.Text = "t"
wait()
game.Players.LocalPlayer.PlayerGui.typewriter.Text = "ty"

1 comment

0

innefficient

In my world, I believe this is easier. Please accept my answer if this helps. Thanks!

local gui = game.Players.LocalPlayer.PlayerGui.typewriter
local times = 1 --time inbetween letters
----
gui.Text = "W"
wait(times)
gui.Text = "Wa"
wait(times)
gui.Text = "Wat"
wait(times)
gui.Text = "Watc"
wait(times)
gui.Text = "Watch"
wait(times)
gui.Text = "Watcha"
wait(times)
gui.Text = "Watcha D"
wait(times)
gui.Text = "Watcha Do"
wait(times)
gui.Text = "Watcha Doi"
wait(times)
gui.Text = "Whatcha Doin"
wait(times)
gui.Text = "Whatcha Doing"
wait(times)
gui.Text = "Whatcha Doing?"

2 comments

0

So you must be new? I turned a 26 lined code into a 5 lined one, you should check it out and see how it works :)

0

This idea is a no-brainer, but it's super inefficient, because of the time it takes to produce this code. Also, watch the output of the text. In between lines 20 and 22, The text transitioned from "Watcha Doi" to "Whatcha Doin."

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