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

Random MiniGame Chooser?

Asked by 8 years ago

Just before I start, I don't have a script. Sorry! NOW THE QUESTION SHALL BEGIN

So, I'm planning on making a MiniGame place, with all sorts of fun stuff. I know how do to everything, but one simple thing.

I'm having trouble using the math.random thingy {I'm not a very good scripter so don't expact good scripting language from me... LOL} picking out random minigames. I have all of my minigames ia lighting, just how do I randomly choose one in a script?

That's my question for today _______________ -=Lukeisbossman64=-

1 answer

Log in to vote
0
Answered by 8 years ago
local minigames = game.ServerStorage.Minigames:GetChildren()
local rg = math.random(1, #minigames)
local cg = minigames[rg]
local cgc = cg:Clone()
cgc.Parent = workspace

Incase you have any more questions, I recommend watching this video: https://www.youtube.com/watch?v=qyrzB50IKuY

Ad

Answer this question