So, I'm learning how to script and I'm messing around with some scripts just for fun. I made one to turn the transparency of the baseplate 0.5 and to turn it 0 and now I need a button to turn it on and off. I want to click the button to make the baseplate transparent and opaque. Here is the script:
local function Transparent(part) --function to turn transparent
part.Transparency = 0.5
end
local function NotTransparent(part) --function to turn opaque
part.Transparency = 0
end
local naotransparente = NotTransparent(mybaseplate) --variable to apply the opacity to the baseplate
local transparente = Transparent(mybaseplate) --variable to apply the transparency to the baseplate
local mybaseplate(Game.Workspace.BasePlate) --variable to simplify the baseplate identity
So what script can I write to make a button? To click it and turn something on and off?

2 comments
What kind of button, ClickDetector, SurfaceGui or ScreenGui?
A ClickDetector