--[[
local function touchEnded(otherPart)
	if(otherPart.Name == "HumanoidRootPart" ) then
		local player = game.Players:FindFirstChild(otherPart.Parent.Name)
		if(player) then
			--print("touch ended")	
			playersNear[player] = nil
			
			if(next(playersNear) == nil) then
				if(doorState == DoorState.Open) then
					StartClosing()
				end
			end
		end
	end
end]]


trigger.Touched:Connect(touched)