Key Card Door Not Working

When it opens, it doesn’t close…
Just completely removes from existence…
Script:

local TweenService = game:GetService("TweenService")

local Debounce  = false
local TimeUntilDoorCloses = 1
local Door = script.Parent

Door.Touched:Connect(function(Touched)
	if Touched.Parent.Name == "Keycard" and Debounce == false then
		Debounce = true
		TweenService:Create(Door, TweenInfo.new(0.3), {Transparency=1}):Play()
		Door.CanCollide = false
		wait(TimeUntilDoorCloses)
		TweenService:Create(Door, TweenInfo.new(0.3), {Transparency=0}):Play()
		Door.CanCollide = true
		Debounce = false
	end
end)

Is the door anchored?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.