But = script.Parent.Parent
Button = script.Parent
But.Name = "Fan On"
Button.BrickColor = BrickColor.new("Really blue")
function oc(PWC)
if But.Name == "Fan On" then
But.Name = "Fan Off"
Button.BrickColor = BrickColor.new("Really red")
if But.Name == "Fan Off" then
But.Name = "Fan On"
Button.BrickColor = BrickColor.new("Really blue")
end
end
end
script.Parent.ClickDetector.MouseClick:connect(oc)
First time using OnClicked. I followed what the Roblox Wiki told me to do for basic onClick functions and I added my own code as well, but it doesn't work. Can someone help?

1 comment
Nope. for some reason it still won't work