So what I am trying do to is one of the more advanced stuff, like this:
while true do
local Bricks = game.Workspace.ExplosionBricks:GetChildren()
local number = math.random(5, #Bricks)
local Chosen = Bricks[number]
Chosen.Name = "ExplosionBrick1"
Chosen.BrickColor = BrickColor.new("Bright red")
local input = game.Lighting.Script:Clone()
wait(1)
local explosion = Instance.new("Explosion")
explosion.BlastPressure = 100000000
explosion.ExplosionType = Enum.ExplosionType.CratersAndDebris
explosion.Position = game.Workspace.ExplosionBricks.ExplosionBrick1.Position
explosion.Parent = workspace
input.Parent = explosion
wait(0.1)
Chosen.BrickColor = BrickColor.new("Institutional White")
wait(1)
Chosen.Name = "ExplosionBrick"
end
So, what I am doing here is I am trying to make 5 parts red, but when I test my game it only makes 1 part red. For this part, I may have to do a for loop.
Question 1: Well, I need someone to tell me if I just returned a table for the 5 chosen parts. Because if I did, it would be easier to do a for loop:
for _, brick in pairs (bricks) do
brick.BrickColor = BrickColor.new("Bright red")
end
Question 2: Despite the pairs part, I need to find out how to make sure that they are named DIFFERENTLY. That will play an easier part in Question 3. How could I do that?
Maybe I should make 5 boolvalues in workspace and name them Name1Taken, Name2Taken, Name3Taken, Name4Taken, Name5Taken
Well, I don't know how to do this part, so can you please help?
Question 3: This question will be added when the answer to question 2 comes. Thank you.
