I'm trying to make my play button fade out every time I click it, but it just won't fade. Here is the code I typed:
local DBO = script.Parent
local PB = script.Parent.PlayButton
local BG = script.Parent.Background
function onClick(MouseButton1Click)
if PB.MouseButton1Click == true then
for i = 0, 1, 0.1 do
PB.BackgroundTransparency = i
end
end
end
script.Parent.PlayButton.MouseButton1Click:connect(onClick)
I can't figure out why this code won't work.

3 comments
remove "if PB.MouseButton1Click == true then" and an "end"
And you didn't add a wait in your for loop, so when it gets there, it'll set the transparency to 1 so quick that it wont give off a "fade" effect.
thanks it worked!!