I would like help with making a text-button that can sett the transparency of certain blocks to 1 after being clicked and if clicked again, it can be sett back to 0.
1: Insert a part in the workspace. 2: insert a ScreenGUI in StarterGUI. 3: Insert a Text Button into the ScreenGUI. 4: (optional) Customize your text button. 5: Insert a LocalScript into your text button. 6: Insert this code:
01 | local button = script.Parent |
02 | local part = game.Workspace.Part --Rename "Part" to whatever you named your part. |
03 |
04 | button.MouseButton 1 Click:Connect( function () |
05 | if part.Transparency = = 0 then |
06 | part.Transparency = 1 |
07 | elseif part.Transparency = = 1 then |
08 | part.Transparency = 0 |
09 | end |
10 | end ) |