So im trying to make a block like in shadow run, where if you click it the transparency will go to 1 after 1-2.5 seconds. Can someone pls help me? Im having no errors but the script just doesnt work.
The script:
CD = script.Parent
P = CD.Parent
P.Transparency = 0
function onMouseClick()
P.Transparency = 0.9
local value = P.Transparency
local number = 0.1
repeat
value += number
task.wait(0.5)
until value == 0
end
CD.MouseClick:Connect(onMouseClick())
