Hello, I'm working on a game with TypeWriter and I want to make it so that if a Part is touched, the TypeWriter starts to type. Here is the code in the part.
script.Parent.Touched:Connect(function()
workspace.ScreenGui.Frame.LocalScript
= text "Good, now let's go to the next part."
for i = 1, #text do
script.Parent.TextLabel.Text = string.sub(text, 1, i)
wait(0.07)
end
end)
Here is the TypeWriter script:
local text = "Hello and welcome to this quiz, I'll be testing you if you're smart."
for i = 1, #text do
script.Parent.TextLabel.Text = string.sub(text, 1, i)
wait(0.07)
end
wait(3)
local text = "Let's see if you can get out of this box..."
for i = 1, #text do
script.Parent.TextLabel.Text = string.sub(text, 1, i)
wait(0.07)
end
So I want it to type "Good, now let's go to the next part." after the player touches the Part. Also, I'm very bad at scripting, so I don't know how to explain much about scripts.
When I touched the part, it doesn't work, it just stays on the text "Let's see if you can get out of this box..."

3 comments
Thank you, it works :D
This is bad code you should put a local function with the text your giving him a memory leak basically wth!
@fistter1 by looking at your profile and your questions it's obvious you don't know what you're on about.