✓ Accepted answer
The Workspace does not have a BrickColor property, so you could predict that this wouldn't work.
Instead, you need to find the objects in the Workspace.
To find all "immediate children" (the things in the workspace but not in submodels) you can use :GetChildren().
function onClick()
local children = Workspace:GetChildren();
for i = 1,#children do
if children[i]:IsA("BasePart") then
children[i].BrickColor = BrickColor.random();
end
end
end
Your definition of the onClick function however was wrong... It should look like the above script plus one additional line like this:
SomeClickDetectorValue.MouseClick:connect(onClick);
1 comment
This Really had not helped me much But thank you for the Help Much appreciated.