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

A TypeWriter-like script?

Asked by 9 years ago

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

Log in to vote
2
Answered by 9 years ago

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
lol true, you managed to get even shorter than me :P dragonkeeper467 453 — 9y
Ad
Log in to vote
1
Answered by 9 years ago

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
0
Your script is also inefficient. You shouldn't be talking. EzraNehemiah_TF2 3552 — 9y
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. Spongocardo 1991 — 9y
Log in to vote
-1
Answered by 9 years ago

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"
0
innefficient dragonkeeper467 453 — 9y
Log in to vote
-4
Answered by
Andorks 23
9 years ago

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?"
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 :) EzraNehemiah_TF2 3552 — 9y
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." Redbullusa 1580 — 9y

Answer this question