function onTouched(hit)
wait(0.1)
script.Parent.Transparency = script.Parent.Transparency + 1
repeat
wait(3)
wait(0.1)
script.Parent.Transparency = script.Parent.Transparency - 1
until script.Parent.Transparency == 1
repeat
until script.Parent.Transparency == 0
end
script.Parent.Touched:connect(onTouched)
Your problem lies in infinite loops. It's a good idea to safeguard by have a counter that breaks the loop if it loops more then a set number of times. You also had an extra repeat loop.
local rateOfChange = .01
function onTouched(hit)
if script.Parent.Transparency <= .5 then
repeat
script.Parent.Transparency = script.Parent.Transparency + rateOfChange
until script.Parent.Transparency >= 1
elseif script.Parent.Transparency > .5 then
repeat
script.Parent.Transparency = script.Parent.Transparency - rateOfChange
until script.Parent.Transparency <= 0
else print"ERROR: Door transparency not recognized."
end
wait()
end
script.Parent.Touched:connect(onTouched)