(Tittle explains most)
Its a textbutton, which has a BrickColorValue in it, named Color and a script in it.
The error says: bad argument #1 to 'new' (Color3 expected, got userdata)
There's bricks in workspace named "Lego Brick" with a bool value inside of them, the script that generates them sets the bool value to true.
The script is:
script.Parent.MouseButton1Click:connect(function()
local color = script.Parent.Color
local brick = game.Workspace:GetChildren()
for i,v in pairs(brick) do
if v.Name == "Lego Brick" then
if v.ScriptGeneratedBrick.Value == true then
v.BrickColor = BrickColor.new(color.Value)
end
end
end
end)
- Line 7 is where i get the error -

1 comment
Thx! It worked!