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
and it appears-up like this:
W
Wa
Wat
Watc
etc. I'm not requesting just a little example.
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
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
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"
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?"