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

How to choose an option for an array?

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

✓ Accepted answer

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.

1 comment

0

Okay i'll try it

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