local Walls = workspace.Level1Ex.Walls
for _, part in pairs (Walls:GetChildren()) do
if Part:IsA("Part") then
part.BrickColor = BrickColor.new(Color3.fromRGB())
end
end
local Walls = workspace.Level1Ex.Walls
for _, part in pairs (Walls:GetChildren()) do
if Part:IsA("Part") then
part.BrickColor = BrickColor.random()
end
end
But that makes every part a different color and not all the same
(in case anyone stumbles onto this later, this worked)
local Walls = workspace.Level1Ex.Walls
local r = math.random(1,255)
local g = math.random(1,255)
local b = math.random(1,255)
for _, part in pairs (Walls:GetChildren()) do
part.BrickColor = BrickColor.new(Color3.fromRGB(r,g,b))
end
Oh you wanted it that way. Your script isn’t the best way to do it. Instead try this
local Walls = workspace.Level1Ex.Walls
local Color = BrickColor.random()
for _, part in pairs (Walls:GetChildren()) do
if Part:IsA("Part") then
Part.BrickColor = Color
end
end