Title says it all,
Watch video to understand.
Code:
local ts = game:GetService("TweenService")
local d = false
local sound = script.Parent.Sound
script.Parent.ProximityPrompt.Triggered:Connect(function(Player)
if d == false then
script.Parent.ProximityPrompt.Enabled = false
d = true
sound:Play()
ts:Create(script.Parent.Parent.Door1, TweenInfo.new(1.9, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {Position = script.Parent.Parent.EndDoor.Position, Orientation = script.Parent.Parent.EndDoor.Orientation}):Play()
wait(3)
sound:Play()
ts:Create(script.Parent.Parent.Door1, TweenInfo.new(1.9, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {Position = script.Parent.Parent.ReferDoor.Position, Orientation = script.Parent.Parent.ReferDoor.Orientation}):Play()
d = false
wait(1.9)
script.Parent.ProximityPrompt.Enabled = true
end
end)