This should do anywho but in future, post your own code for quicker results:
d = Workspace.Door --Change this to the directory of your door.
debounce = false
doorOpening = false
function click()
if debounce == false then
debounce = true
if doorOpening == false then
for i = 1, 5 do --Do this 5 times
wait(0.1) --For aesthetics
d.Size = d.Size - Vector3.new(2, 0, 0) --Minus one from both sides of door by minusing 2
d.CFrame = d.CFrame - Vector3.new(1, 0, 0) --Minus one in x direction to keep it in place
end
doorOpening = true
else
for i = 1, 5 do --Do this 5 times
wait(0.1) --For aesthetics
d.Size = d.Size + Vector3.new(2, 0, 0) --Add one from both sides of door by adding 2
d.CFrame = d.CFrame + Vector3.new(1, 0, 0) --Add one in x direction to keep it in place
end
doorOpening = false
end
debounce = false
end
end
blahblah.ClickDetector:connect(click)
|