I created this script that changes BrickColor from each part of a model. However, I encountered a problem. After the parts go through the color changing process, they reset back to white at the end for no apparent reason. My script works through copying a script and pasting it inside each part in the "Wall" model. Here's the two scripts:
Main script:
game.Workspace.Bu.ClickDetector.MouseClick:connect(function()
for _, object in pairs(game.Workspace.Wall:GetChildren()) do
local script = game.Workspace.copy_me:Clone()
script.Parent = object
end
end)
Script being copied (copy_me):
object = script.Parent
object.BrickColor = BrickColor.new("Dark taupe")
wait(0.1)
object.BrickColor = BrickColor.new("Copper")
wait(0.1)
object.BrickColor = BrickColor.new("Nougat")
wait(0.1)
object.BrickColor = BrickColor.new("Pastel brown")
wait(0.1)
object.BrickColor = BrickColor.new("Salmon")
wait(0.1)
object.BrickColor = BrickColor.new("Pastel Orange")

1 comment
Try not using script as a variable name, as it is a keyword. (line 3)