Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a Text Button that setts transparency of said blocks to 1 once clicked?

Asked by 3 years ago
Edited 3 years ago

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.

0
What have you tried so far? radiant_Light203 1166 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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:

local button = script.Parent
local part = game.Workspace.Part --Rename "Part" to whatever you named your part.

button.MouseButton1Click:Connect(function()
    if part.Transparency == 0 then
        part.Transparency = 1
    elseif part.Transparency == 1 then
        part.Transparency = 0
    end
end)


0
it should work NickyPlayz2011 82 — 3y
Ad

Answer this question