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