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

What did I do wrong in my SurfaceGui Script?

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

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.

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