function onTouched(hit) script.Parent.Door.Transparency = 0.6 wait(0.1) script.Parent.Door.CanCollide = false wait(2) script.Parent.Door.Transparency = 0 wait(0.1) script.Parent.Door.CanCollide = true end script.Parent.Touched:connect(onTouched)
Here is what was wrong with your script
1. You didn't what would hit the door (Which would be the humanoid)
function onTouched(hit) local h = hit.Parent:findFirstChild("Humanoid") if h~=nil then script.Parent.Door.Transparency = 0.6 wait(0.1) script.Parent.Door.CanCollide = false wait(2) script.Parent.Door.Transparency = 0 wait(0.1) script.Parent.Door.CanCollide = true end end script.Parent.Door.Touched:connect(onTouched)
You can change the last line to however you set it as, I just added door, for it to work for me since, I don't know what the model is set up for the door.