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

How do I make a for loop that is in alphabetical order?

Asked by 3 years ago

The order of a for loop seems to be when the instances were added, so how can I make it go in alphabetical order?

1 answer

Log in to vote
0
Answered by 3 years ago

Print the letter when the instance is added, or if the instances are in a loop match up the loop number with wait() I put together a while true do loop that shows the simplicity

while true do
    print("A")
    wait(1)
    print("B")
    wait(1)
    print("C")
    wait(1)
    print("D")
    wait(1)
    print("E")
    wait(1)
    print("F")
    wait(1)
    print("G")
    wait(1)
    print("H")
    wait(1)
    print("I")
    wait(1)
    print("J")
    wait(1)
    print("K")
    wait(1)
    print("L")
    wait(1)
    print("M")
    wait(1)
    print("N")
    wait(1)
    print("O")
    wait(1)
    print("P")
    wait(1)
    print("Q")
    wait(1)
    print("R")
    wait(1)
    print("S")
    wait(1)
    print("T")
    wait(1)
    print("U")
    wait(1)
    print("V")
    wait(1)
    print("W")
    wait(1)
    print("X")
    wait(1)
    print("Y")
    wait(1)
    print("Z")
    wait(1)
end
Ad

Answer this question