✓ Accepted answer
I personally can't read random code. Use a code block. You've been here long enough, and I know you've been told this before.
Here's your code in a code block,
Door = script.Parent
function onClicked()
Door.Transparency=.6
Door.CanCollide=false
end
Door.ClickDetector.MouseClick:connect(onClicked)
if Door.ClickDetector.MouseClick:connect(onClicked) then
wait(2)
Door.Transparency=0
Door.CanCollide=true
end
It looks to me like you found a free model, tried to edit it, failed, and came here. Maybe not though. I'm just telling you what it looks like.
Just move the code in the conditional statement into the function "onClicked"
local Door = script.Parent
function onClicked()
Door.Transparency=.6
Door.CanCollide=false
wait(2)
Door.Transparency=0
Door.CanCollide=true
end
Door.ClickDetector.MouseClick:connect(onClicked)
Good Luck
If I answered your question, don't forget to click the accept answer button next to this answer.
2 comments
There is no code, please edit your question.
Oops I forgot, sorry.