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 between random strings?

Just like you can pick random number with math.random are there any way to pick between random strings for example printing out random strings between : "Hi welcome" or "Hi how are you"

1 answer

✓ Accepted answer

You could do that with this simple example:

local stringTable = {
	
	"sneaky beaky",
	"Hello world!",
	"helo my friendo",
	"yeah",
	"yes",
	"no"
	
}
local randomString = math.random(1,#stringTable)

for i,v in pairs(stringTable) do
	
	if i == randomString then
		
		print(v)
		
	end
	
end

You can add as many strings as you want!

2 comments

0

Thank you again my friend!

0

Thank you again my friend!

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