#How do i make a variable that picks randomly from somewhere
15 messages · Page 1 of 1 (latest)
so you can pick randomly from a table
which would be
local thingstopick = {
"thing1",
"thing2",
"thing3"
}
local randomthing = thingstopick[math.random(1,#thingstopick)
so it will generate a random number from 1 to however many instances is inside a table
then pick a random one from the table
can't i pick from a folder or a backpack?
you can, it will have to be for example
local thingstopick = folder:GetChildren()
it's still a table
so uhm i do math.random?
what is the 1 for there