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

[SOLVED] How to print something if a brick color is a certain color?

local wall = game.Workspace.zed

wall.BrickColor = BrickColor.new("Really red")

script.Parent.ClickDetector.MouseHoverLeave:Connect(function(pryc)

wall.BrickColor = BrickColor.new("Medium green")

end)

if wall.BrickColor == BrickColor.new("Medium green") then print("Hi it is green")

end

-- This is my script but it isn't working. When my mouse leaves the wall it turns green, but it doesn't print hi it is green. Thanks

1 comment

0

Please put your code into a code blob or it'll be difficult to comprehend.

1 answer

You need to loop if to make it check wall's color always, like:

local wall = game.Workspace.zed

wall.BrickColor = BrickColor.new(“Really red”)
script.Parent.ClickDetector.MouseHoverLeave:Connect(function(pryc)
wall.BrickColor = BrickColor.new(“Medium green”)
end)
while wait() do
if wall.BrickColor = BrickColor.new("Medium green") then
print("Desired text go here")
end
end

1 comment

0

Thanks!

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