So I want a meteor strike at one of the bricks inside a folder. Then I used a for i,v in pairs loop and a :GetChildren() function, it kinda works. But, I lands in the order the I placed the positions, and not a random. Yes I know in pairs loops go in order, but how can I make it land at a random place? Thanks!
My script so far:
explosion = game.Workspace.Explosions:GetChildren()
for i,v in pairs(explosion) do
local part = Instance.new("Part")
part.Shape = "Ball"
part.Size = Vector3.new(10,10,10)
part.BrickColor = BrickColor.new("Burnt Sienna")
part.Position = Vector3.new(v.Position.X,v.Position.Y+200,v.Position.Z)
part.Parent = game.Workspace
wait(1.8)
local exp = Instance.new("Explosion")
exp.Parent = game.Workspace
exp.BlastPressure = 40
exp.BlastRadius = 120
exp.Position = part.Position
wait(2)
part:Destroy()
end

5 comments
ITS IMPORTANT THAT THE SEED IS SET FIRST BEFORE USING MATH.RANDOM
Ok
I recommend you use the Random type instead, math has a very poor implementation, hence why they added the new Random.
What does math.randomseed(tick()) do?
@gullet wrong. math.random now follows the same algorithm as Random, but the Random datatype has its own benefits nonetheless