I'm still new at scripting and sort of stumped. I've created a loop that can randomly paint some windows, but I want it to randomly select a color and then paint all of the parts the same color. Instead, it randomly paints each part a different color.
game.ReplicatedStorage.Paint.OnServerEvent:Connect(function(player)
wait (1)
local window = game.Workspace[player.Name.."'s House"].Windows
local b = window:GetChildren()
local children = window:GetChildren()
for i = 1, #children do
local child = children[i]
if children[i].ClassName == "Part" then
children[i].BrickColor = BrickColor.Random()
print("painting " .. child.Name)
end
end
end)

1 comment
So simple! Thanks for the help!