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

4 comments
oh and by the way this script will only work once or twice depending on what the default transparency is, if you need it to loop forever make sure to add the Decal.Transparency = 1 in the else statement.
That did the trick, it's been a while since I've started to script again. Thanks for the help.
could you please accept the answer then, thank you!
Sorry, I'm kinda new to this website.