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

Why is the part not detecting the color black?

So I am trying to make a script where it detects the color black, but it detects other colors than black. The line "If BrickColor.Black() then" does not work. How do I fix this?

function MouseHoverEnter(playerWhoHovered)
	game.workspace.Part1.BrickColor = BrickColor.Random()
	if BrickColor.Black() then
		print("Black")
	end
end
script.Parent.ClickDetector.MouseHoverEnter:Connect(MouseHoverEnter)

1 answer

Your not making any comparisons. Try this:

 if( game.workspace.Part1.BrickColor == BrickColor.Black() )then

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