Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My button wont turn transparent when I click it?

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

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.