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

What did I do wrong in my SurfaceGui Script?

Asked by 10 years ago

Something in the script is not working, it only does one message, but not two, what have I done wrong? Here is the script;

repeat wait(0)until script.Parent and script.Parent.Parent and script.Parent:FindFirstChild("TextLabel")
local msg="Hello, Welcome to the MIDI Player!" --It only does this message
local msg2="I hope you will like the music, there is a large variety of music to choose from!" --Isn't doing this one
local hint=script.Parent.TextLabel

while wait(4)do
for i=1,#msg do
hint.Text=tostring(string.sub(msg,1,i))
wait(0.1)
end
wait(4)
hint.Text=""
wait(.50)
for e=1,#msg2 do
hint.Text=tostring(string.sub(msg,1,e))
wait(0.1)
end
end

1 answer

Log in to vote
0
Answered by 10 years ago
repeat wait(0)until script.Parent and script.Parent.Parent and script.Parent:FindFirstChild("TextLabel")
local msg="Hello, Welcome to the MIDI Player!" --It only does this message
local msgtwo="I hope you will like the music, there is a large variety of music to choose from!" --Isn't doing this one
local hint=script.Parent.TextLabel

while wait(4)do
for i=1,#msg do
hint.Text=tostring(string.sub(msg,1,i))
wait(0.1)
end
wait(4)
hint.Text=""
wait(.50)
for e=1,#msgtwo do
hint.Text=tostring(string.sub(msg,1,e))
wait(0.1)
end
end

You can't use numbers in variables. That's what was wrong.

Ad

Answer this question