For example, instead of having lets say 1,5 it would be: hello,(or) goodbye
Okay so im trying to make this script print out words just like math.random prints out numbers, I know how to do math rand b ut not with words
Here is my math.random
while true do wait(0.8) local variable1 = math.random(1,4) local variable2 = math.random(5,10) print(variable1, variable2) end
Any help appreciated
ANSWER: You will still need a random number, and you will use that random number to get a random index from an Array of words.
Example:
local wordList = { "Hello", "Goodbye", "Yes", "No", "What is going on here?" } function randomWord() return wordList[math.random(#wordList)] end print(randomWord()) print(randomWord()) print(randomWord())