local Folder = game.Workspace.Doors:GetChildren()
local ts = game:GetService('TweenService')
local debounce = false
for _, door in pairs(Folder) do
local cd = door:FindFirstChild('ClickDetector')
local function Open()
local open = ts:Create(door, 1.6, {['CFrame'] = door.CFrame * CFrame.new(0,door.Size.Y, 0)})
local close = ts:Create(door, 1.6, {['CFrame'] = door.CFrame})
if cd then
if debounce == false then
debounce = true
open:Play()
wait(2)
close:Play()
wait(1.6)
debounce = false
end
end
end
cd.MouseClick:Connect(Open)
end
all doors with click detector in folder are supposed to be able to tween open
error is line the first tween 'Unable to cast double to tweenInfo'