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

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

Asked by 5 years ago
Edited 5 years ago

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

0
Please put your code into a code blob or it'll be difficult to comprehend. SCP774 191 — 5y

1 answer

Log in to vote
0
Answered by
enes223 327 Moderation Voter
5 years ago

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
0
Thanks! LegoTheDev 0 — 5y
Ad

Answer this question