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

How do I pick a random name from a table?

Asked by 4 years ago

I want that everytime someone steps on a part it will generate a random level I was trying to find a way but when I try to do it then its just generating the first value on the table

0
what is the code to randomly generate a level? gs_115 11 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

you cant ask for someone to make a code for you in this website. Here is some tips, you can randomly pick a name inside a table with math.random example :

local table = {"a","b","c"}
print(table[math.random(1,3)])
0
output : a or b or c Blackbooks 138 — 4y
Ad

Answer this question