✓ Accepted answer
If you're using the regular HopperBin build tools, the clone tool will not clone the descendants of the part. Therefore your code will not clone to the next part.
If you wanted this to work for cloned parts, you would probably want to do the following...
We're going to start out by popping a script in ServerScriptService and make sure your special parts are named something distinctive so we know to connect our event.
local partName = "clickyPart"
game.Workspace.ChildAdded:Connect (function(child)
if child:IsA("BasePart") and child.Name == partName then
local clickDetector = Instance.new("ClickDetector")
clickDetector.Parent = child
clickDetector.MouseClick:Connect(function()
if child.BrickColor == BrickColor.new("Lime green") then
wait(0.1)
child.BrickColor = BrickColor.new("Really red")
elseif child.BrickColor == BrickColor.new("Really red") then
wait(0.1)
child.BrickColor = BrickColor.new("Lime green")
end
end)
if child.BrickColor == BrickColor.new("Lime green") then
child.Anchored = true
elseif child.BrickColor == BrickColor.new("Really red") then
child.Anchored = false
end
end
end)
If this didn't help or if you're having any other issues, just comment on the answer and I'll try to help you further.
If this helped, remember to accept and upvote this answer.