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

How to choose an option for an array?

Asked by 3 years ago

I tried using this:

     local randomText = {"hello", "i love you", "a chap send you a message", "you are weird", "wanna be my bestie?", "what is your tag?", "you stink", "*dies cutely*", "press alt+f4 for sprint", "i am flamgo!"}
    for i = newMsg.Text, randomText do

    end

I tried to do printing but nothing happened at all

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

Try this -

local randomText = {"hello", "i love you", "a chap send you a message", "you are weird", "wanna be my bestie?", "what is your tag?", "you stink", "*dies cutely*", "press alt+f4 for sprint", "i am flamgo!"}
for i, randomText in pairs(randomText) do
    print(randomText)
end

Using in pairs lets you select any option from the array.

0
Okay i'll try it RektwayYTB 123 — 3y
Ad

Answer this question