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

Is there an easier way to do this?

Asked by 10 years ago
letters = {"T", "To", "To ", "To a", "To ac", "To acc", "To acce", "To acces", "To access", "To access ", "To access t", "To access th", "To access the", "To access the m", "To access the ma", "To access the mai", "To access the main", "To access the main ", "To access the main m", "To access the main me", "To access the main men", "To access the main menu", "To access the main menu ", "To access the main menu p", "To access the main menu pr", "To access the main menu pre", "To access the main menu pres", "To access the main menu press", "To access the main menu press ", "To access the main menu press '", "To access the main menu press 'q", "To access the main menu press 'q'"}
letters2 = {"T", "To", "To ", "To c", "To cl", "To clo", "To clos", "To close", "To close ", "To close t", "To close th", "To close the", "To close the ", "To close the m", "To close the ma", "To close the mai", "To close the main", "To close the main ", "To close the main m", "To close the main me", "To close the main men", "To close the main menu", "To close the main menu ", "To close the main menu p", "To close the main menu pr", "To close the main menu pre", "To close the main menu pres", "To close the main menu press", "To close the main menu press ", "To close the main menu press '", "To close the main menu press 'q", "To close the main menu press 'q'"}
while true do
for Index,letters in ipairs (letters) do
    wait(.1)
    script.Parent.Text = letters
end
wait(1)
for Index,letters2 in ipairs (letters2) do
    wait(.1)
    script.Parent.Text = letters2
end
wait(1)
end

1 answer

Log in to vote
2
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

Yes lol. Use string.sub in a for loop to get that 'typing' effect.

local msg = "To close the main menu press 'q'"

while wait(1) do
    for i = 1,msg:len() do
        script.Parent.Text = msg:sub(1,i)
        wait(.1)
    end
end

Hope I helped(:

+1

2
lol i look liek a n00b now. Senor_Chung 210 — 10y
2
It's okay lol, everyone makes silly mistakes. Goulstem 8144 — 10y
0
I ended up using this script, and I have a question, Goulstem. How would you break the loop after it played once? SchonATL 15 — 10y
0
Take it out of the while loop,. Goulstem 8144 — 10y
Ad

Answer this question