local db = false
script.Parent.ClickDetector.MouseClick:Connect(function()
script.Parent.Transparency = 0.1
wait(0.1)
script.Parent.Transparency = 0.2
wait(0.1)
script.Parent.Transparency = 0.3
wait(0.1)
script.Parent.Transparency = 0.4
wait(0.1)
script.Parent.Transparency = 0.5
wait(0.1)
script.Parent.Transparency = 0.6
wait(0.1)
script.Parent.Transparency = 0.7
wait(0.1)
script.Parent.Transparency = 0.8
wait(0.1)
script.Parent.Transparency = 0.9
wait(0.1)
script.Parent.Transparency = 1
script.Parent.CanCollide = false
db = true
wait(2)
if script.Parent.Transparency == 1 then
script.Parent.Transparency = 0.9
wait(0.1)
script.Parent.Transparency = 0.8
wait(0.1)
script.Parent.Transparency = 0.7
wait(0.1)
script.Parent.Transparency = 0.6
wait(0.1)
script.Parent.Transparency = 0.5
wait(0.1)
script.Parent.Transparency = 0.4
wait(0.1)
script.Parent.Transparency = 0.3
wait(0.1)
script.Parent.Transparency = 0.2
wait(0.1)
script.Parent.Transparency = 0.1
wait(0.1)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
db = true
wait(2)
end
end)
db = false
Yes i do have a clickdectector in my union(part). Yes this is in the same script. Could have made a shortcut with local .. = .. but decided to not do that.
This is meant to make it so if the door is clicked alrdy it should be transparency = 1 after 1 second + cancollide = false and if transparency = 1 then when u click it should make the door go from transparency 1 to 0 so its fully visible + making it so u cant go through it, added debounce which doesnt work either, Im really confused.
Pls help.

3 comments
This answer could work, but you are encouraging the fact that he is wasting lines of code. Maybe you should have used a for loop.
Wow
Indeed, but he didn't ask for anything else other than making the script work.