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

My button wont turn transparent when I click it?

Asked by 5 years ago
local CD = script.Parent

local function OnClicked()

    script.Parent.Transparency = 1

end


CD.Mo:Connect(OnClicked())

(I have a ClickDetector in the part) (The name of the brick is Button)

1 answer

Log in to vote
0
Answered by 5 years ago

You are changing the transparency of the click detector, try adding a variable to the block like this one. Also on line 10 you need to write "MouseClick" not "Mo" :

(Place the script inside the click detector and then the click detector inside the button. Type this inside the script)

local CD = script.Parent
local block = script.Parent.Parent

local function OnClicked()
    block.Transparency = 1
end

CD.MouseClick:Connect(OnClicked)
Ad

Answer this question