--				-1 = Closed
--				0 = Active
--				1 = Open


function getItems() 
	for _,v in pairs(script.Parent:GetChildren()) do 
		if ((v:IsA("BasePart")) and (v.Name == "Bar")) then 
			table.insert(_items,v) 
		end 
	end 
end 

function main() 
	local d = door 
	door = 0 
	script.Parent.Button.BrickColor = BrickColor.new("New Yeller") 
	for i = 0,5,0.05 do 
		for _,v in pairs(_items) do 
			v.CFrame = v.CFrame * CFrame.new((0.20*(-d)),0,0) 
		end 
		wait() 
	end 
	if (d == (-1)) then 
		script.Parent.Button.BrickColor = BrickColor.new("Really red") 
	elseif (d == 1) then 
		script.Parent.Button.BrickColor = BrickColor.new("Bright green") 
	end 
	door = d 
end 

script.Parent.Button.Click.MouseClick:connect(function() 
	if (door == 0) then return end 
	door = (door*(-1)) 
	main() 
end) 

getItems() 
