Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is the part not detecting the color black?

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
2
Answered by
royaltoe 5144 Moderation Voter Community Moderator
4 years ago

Your not making any comparisons. Try this:

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

Answer this question