I'm trying to change the color of a brick whether or not a boolean value is true or false and I will have separate scripts control the variable which will change the colors. but while testing by checking the value its wouldent work and the button wulold just stay black and neither of the colors. can anyone help?
if script.Parent.on.Value == true then script.Parent.Color = Color3.new(0, 255, 0) end if script.Parent.on.Value == false then script.Parent.Color = Color3.new(255, 0, 0) end
Have you used a .Changed event to make sure it connects upon anything being changed within' the BoolValue?
If not, try:
script.parent.Changed:Connect(function() if script.Parent.on.Value == true then script.Parent.Color = Color3.new(0, 255, 0) end if script.Parent.on.Value == false then script.Parent.Color = Color3.new(255, 0, 0) end end)