I'm trying to make a small script where you click the computer button to turn it on. It's basically not much, it only changes the button color and the decals transparency, that's all. But for some reason it's not working.
Here's the script:
function onClicked() if script.Parent.Parent.Screen.Decal.Transparency == 1 then script.Parent.BrickColor = "LimeGreen" script.Parent.Parent.Screen.Decal.Transparency = 0 else script.Parent.Parent.Screen.Decal.Transparency = 1 script.Parent.BrickColor = "Crimson" end end script.Parent.ClickDetector.MouseClick:connect(onClicked()
function onClicked() if script.Parent.Parent.Screen.Decal.Transparency == 1 then script.Parent.BrickColor = BrickColor.new("LimeGreen") script.Parent.Parent.Screen.Decal.Transparency = 0 else script.Parent.Parent.Screen.Decal.Transparency = 1 script.Parent.BrickColor = BrickColor.new("Crimson") end end script.Parent.ClickDetector.MouseClick:connect(function() onClicked() end)
see if this will work, not too sure myself