I'm new to this Tables thing, the one that goes like this ["Random", 20, true]
. I just need help on one little thing.
I have the following table:
a = [109412, 1210542, 24541]
I want to randomly pick one number and set the script's Parent's name to that number. Would it be something like this:
ab = script.Parent ab.Name = ""..#a
Thanks for your help!
Tables in Lua are created using curly braces. Square braces are used to access table members.
a = {109412, 1210542, 24541} script.Parent.Name = a[math.random(#a)]
u can also do
a = {109412, 1210542, 24541} script.Parent.name = a[math.random(1, #a)]
sorry i think i fixed it
a = {109412, 1210542, 24541} ab = script.Parent ab.Name = "" ..a[math.random(1, #a)]