Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I keep getting a error saying it should be Color3 but, its a brickcolor?

(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 answer

✓ Accepted answer

You don't need to create a new BrickColor with color.Value. It is already a brickcolor

 v.BrickColor = color.Value

1 comment

1

Thx! It worked!

This discussion is preserved as it was. New answers, comments, and votes are closed.